471,357 Members | 1,122 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,357 software developers and data experts.

How to Stop Serviced Component so Uninstall removes it completely

We have several serviced components written in .NET 1.1. Using Visual
Studio, we have an installer project that creates an installer for them.

The components are installed properly into the GAC and show in the Component
Services control panel.

The issue is when we uninstall or want to upgrade the components. What we
have found is if there are live instances pooled and running (which is always
the case as we want them to be ready for calls by a web application), then if
we just uninstall or try an upgrade install, the component is not removed
from the Component Services list. After an upgrade we would then see two
versions registered, the old one and the new one where the old one won't of
course work because the files have been removed. This causes issues with the
calling web application which seems to get confused.

It's also confusing to look at at the least.

However, if we stop the component first by going to the Component services
control panel and right clicking Shutdown on it. Then when we do an
uninstall or an upgrade install, the old version is removed from the
Component Services list and the new one added and everything is fine.

So my question is....is there a way to put a custom action in the Visual
Studio installer so that during it's "before uninstall" function it can
shutdown the component so we don't have to do it manually.

I know how to tell the installer project to do something but I don't know
how you shutdown a component like this programatically.
Jul 29 '05 #1
3 5281
Hi Robert,
......
I know how to tell the installer project to do something but I don't
know how you shutdown a component like this programatically.


If you want to shut down and remove a component service programmatically,
you can use Component Services Administration (COMAdmin) objects to acheive
it, I suggest you manipulate the COMAdmin objects in a vbs file in order
you can call it in a custom action in your installer program.

For details of how to shut down and remove a component service in a vbs
file, please refer to the following MSDN article and related newsgroup
thread, which has a helpful sample on this issue:

Automating COM+ Administration
http://msdn.microsoft.com/library/de...us/cossdk/html
/f302eb02-2ef5-42ee-a18f-59f7e60b38df.asp

Update a COM+ DLL in Component Services on Win2K
http://groups-beta.google.com/group/...owse_thread/th
read/9cca0e35fa656695/27f2b46be706beaa?lnk=st&q=uninstall+%22component+s ervi
ces%22+vbscript&rnum=1&hl=en#27f2b46be706beaa
Hope this helps!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default...sdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 30 '05 #2
Thanks, I was able to get this to work by overriding the OnBeforeUninstall
event in a custom installer in the project and adding the below:

' Instantiate a COMAdminCatalog object.
Dim objCatalog As COMAdminCatalog = CreateObject("COMAdmin.COMAdminCatalog")

objCatalog.ShutdownApplication("Analyzer Control Publisher Application")

Works great.

Thanks.
R-

""Gary Chang[MSFT]"" wrote:
Hi Robert,
......
I know how to tell the installer project to do something but I don't
know how you shutdown a component like this programatically.


If you want to shut down and remove a component service programmatically,
you can use Component Services Administration (COMAdmin) objects to acheive
it, I suggest you manipulate the COMAdmin objects in a vbs file in order
you can call it in a custom action in your installer program.

For details of how to shut down and remove a component service in a vbs
file, please refer to the following MSDN article and related newsgroup
thread, which has a helpful sample on this issue:

Automating COM+ Administration
http://msdn.microsoft.com/library/de...us/cossdk/html
/f302eb02-2ef5-42ee-a18f-59f7e60b38df.asp

Update a COM+ DLL in Component Services on Win2K
http://groups-beta.google.com/group/...owse_thread/th
read/9cca0e35fa656695/27f2b46be706beaa?lnk=st&q=uninstall+%22component+s ervi
ces%22+vbscript&rnum=1&hl=en#27f2b46be706beaa
Hope this helps!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default...sdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 30 '05 #3
OK, we are glad to help you on this issue:)

Good Luck!
Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default...sdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Aug 2 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Ansari | last post: by
reply views Thread by Mihiri | last post: by
4 posts views Thread by Pete Wittig | last post: by
reply views Thread by =?Utf-8?B?QkY=?= | last post: by
2 posts views Thread by =?Utf-8?B?QkY=?= | last post: by
reply views Thread by bharathreddy | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.