cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Kill process on uninstall??

All,

I'm sorry if this has been talked about before but I was unable to find exactly what I need after doing a search.

Please bear with me as I am completely new to all of this and apologize now if I sounds like a "newb".

I have an .exe that I want to turn in to an .MSI. I use the repackager to do just that and everything is working fine...except for the uninstall. When trying to uninstall, I get an error stating that another application has exclusive access to a file. Well the application that has exclusive access is the program I'm trying to uninstall...the .exe. I have searched and searched to try and find a way to kill that process as soon as I begin the uninstall with no luck!

I have tried to stop the service through the Control NT Services - Yes to Uninstall Stop - but that did not do anything.

Any help would be greatly appreciated!! Again I'm sorry if this is a simple answer...I'm new to all of this!

Thanks,
Mark
(1) Reply
AFMarkD wrote:
All,

I'm sorry if this has been talked about before but I was unable to find exactly what I need after doing a search.

Please bear with me as I am completely new to all of this and apologize now if I sounds like a "newb".

I have an .exe that I want to turn in to an .MSI. I use the repackager to do just that and everything is working fine...except for the uninstall. When trying to uninstall, I get an error stating that another application has exclusive access to a file. Well the application that has exclusive access is the program I'm trying to uninstall...the .exe. I have searched and searched to try and find a way to kill that process as soon as I begin the uninstall with no luck!

I have tried to stop the service through the Control NT Services - Yes to Uninstall Stop - but that did not do anything.

Any help would be greatly appreciated!! Again I'm sorry if this is a simple answer...I'm new to all of this!

Thanks,
Mark


Hi Mark,

The Control NT Service view would be the correct thing to use (assuming that it's available in the Service Control Manager). What you'll do is add this to the component that the executable belongs to, making sure that the name of the service matches the Internal Service name in the SCM (this will be listed as the 'Service Name' when you right clight in SCM -> properties).

This will ensure that the event fires during uninstall (since there's definitely an action being taken against the component), and as well it will make the correct request to the SCM for the 'Uninstall Stop' and 'Uninstall Delete' methods.

Now, if this isn't a service, that it will be necessary to use a Custom Action to handle this. There's some good sample code here for this in InstallScript:

http://www.installsite.org/pages/en/isp_ext.htm#ShutDownRunningApp

Hope this helps