I would like to know the recommended procedure for a Windows service to self-update.
The main questions are:
strong key
would be an alternative?) I also accept suggestions from (unpaid) libraries that perform this function.
I would like to know the recommended procedure for a Windows service to self-update.
The main questions are:
strong key
would be an alternative?) I also accept suggestions from (unpaid) libraries that perform this function.
There is no simple way to make a .Net process self-update. It would be something like committing haraquiri and continuing to live to rebuild itself. The updater process would have to be running in a different Domain and the Process Domain to be updated should be destroyed.
My recommendation:
Use an auxiliary process to perform the update.
1) Your service detects the need to update, downloads the file, starts the auxiliary process of update, terminates the execution autonomously.
2) The auxiliary process updates and restarts the service, waits for indication of execution validation and closes.
Note: You should take advantage of a backup of the previous version, because if it does not pass the update validation the previous version can be put back into operation.
You can have it download the update to a temporary folder and at the end of the update another executable (it may even be a .bat file) move the files and re-run the program.
Interrupt ClickOnce and / or WebService to do this for you
See this page that can help you Home The web service should be able to read an XML file that contains all the information of a possible update. I chose to use an XML and not a Database, for the simplicity of it.