Aborting an installation programmatically

  • Thread starter Thread starter K0
  • Start date Start date
K

K0

Hi everyone I have a question:

I have created a small windows service and runs ok.

I have a problem, tho. I would like to abort uninstalling of the service if
it is currently running, so I thought i could use a servicecontroller for
checkin if it is running and then...

That is the problem, how can i stop uninstalling? Override beforeuninstall?
Override uninstall method???

Can someone post some code sample on how to safely abort an uninstall
process?

Thanx and bye
 
Override the Uninstall mehtod and raise a new InstallException (or
somethign similar).

However, I strongly urge you to consider shutting down the service instead
and continuing uninstallation in the Uninstall method. User's really hate
to not be able to uninstall something!
:-)
 
Back
Top