We need to create a windows service that has the ability to self update.
Three options spring to mind,
a second service that manages the retrieval, uninstallation and installation of the first service.
Use of some third party framework (suggestions welcome. I believe .NET supports automatic updating for windows forms apps, but not windows services)
Use of a plugin model, whereby the service is merely a shell containing the updating and running logic, and the business logic of the service is contained in a DLL that can be swapped out.
Can anyone shed some light on the solution to this problem?
Thanks
You can't have a service update itself because the . dll that is running will not stop. Seperating the business logic layer would be a good option. You could also rewrite the main service to run under reflection by a master or control service.
Windows Server Update Services (WSUS), previously known as Software Update Services (SUS), is a computer program and network service developed by Microsoft Corporation that enables administrators to manage the distribution of updates and hotfixes released for Microsoft products to computers in a corporate environment.
If you want to install the update now, select Start > Settings > Update & Security > Windows Update , and then select Check for updates. If updates are available, install them.
Google have an open-source framework called Omaha which does exactly what your point 1. describes. It runs as a scheduled Windows task in the background, outside the applications it manages. Google use Omaha to auto-update their Windows applications, including Chrome. Because it comes from Google, and because it is installed on every Windows machine that runs Chrome, Omaha is extremely powerful.
There is an article online that explains in more detail how Omaha can be used to update Windows Services. It argues that Omaha is an especially good fit for Services (vs., say, GUI applications) because of its asynchronous nature.
So you could do your points 2. and 1. by using Omaha. I'm afraid I don't know how you would do 3.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With