I am about to develop a program which will be installed and run as a Windows Service on the back-end servers (with internet access) of several clients. I do not have physical access to the servers. What I am working on is a scheme for reliably rolling out updates to the program.
I have spend quite a lot of time looking for best practices for Windows Service auto-updates, but have found very little useful information. Most techniques, such as ClickOnce, seem to cater primarily for Windows Forms-based applications.
My current plan is:
- When updates are available, have the running service download, install, and start an update service.
- The update service will download the new version of the main service and install it side-by-side of the current, still active version.
- The update service next stops the old version and then starts the new version of the service.
- The new version disables the update service during startup.
Some important concerns for me are:
- Being able to handle updates both to the main service and the update service
- Being able to handle interruptions such as power failure or a connection failure at any point during the update process
What am wondering is if this a common way to solve this problem and/or if I am missing anything crucial. Is it too complicated, or perhaps far too simplistic? How would you have done it (or, even better, how have you done this successfully)?
Thanks!