views:

40

answers:

0

Is there a straightforward way to smoothly upgrade a running service using a VS2008 installer? All I want to do is stop the service and do the install. It seems this wouldn't be too much to ask.

If you invoke the ProjectInstaller's Install, and the service has been installed by a previous version, it throws an exception regardless of whether the service is running or not.

If you override the Install method so that it stops the service if it is running, and then doesn't invoke the base class Install method, then the magic stateSaver structure doesn't get filled in and all hell breaks loose.

If you put a condition on the Install custom action, then the Install method never gets invoked, so it doesn't matter if the Install method stops the running service. The old version of the service continues to run and the user is prompted to reboot the computer.

It seems logical that the service should be stopped somewhere other than the Install method, since we only want to install the service if it hasn't been installed in the past. Is there a way to do this without invoking some script to hack the msi after the build?

And one last question. Does Microsoft want me to jump off a freaking bridge? This kind of insanity is destroying my business.