I have a windows service (C#, with ability to install itself). I also have an installer package the can update the windows service. This updater is currently run manually. The (NSIS) installer/updater runs net stop myService
to stop the service, then does the install/update and then net start myService
.
My goal is to have the service update itself in some way. This excellent question, and its highest rated answer lists all the possible ways one could probably approach the problem.
It seems to me the simplest, best option is to have the service Proces.Start()
the installer. The only minor caveat, is that the installer needs to know how to stop the service for the duration of the upgrade - which my installer already has.
I've heard rumors that this is problematic, but in my testing, things seem to be working well. What, if any, are the known issues that will cause problems with this?