How to update my windows service automatically in .NET?

I release several modifications per week for my Windows services, and my users must update them manually. I thought about minimizing my own auto-update component, but I heard of ClickOnce, which seems to be suitable only for Windows Forms, not for Windows Services. Is there a similar solution for my case?

And if I have to develop this function myself, should I:

  • Stop the service, replace the files, start the service?

or

  1. Uninstall and install the new version?

for both options, I think that I will need administrator rights that require user intervention, so it’s not automatic at all, right?

+3
source share
2 answers

You may have a service just a wrapper. Every time (once a day?) There is a service check for a new version, requesting a web server. If a new version exists, unload the actual assembly that does the work, download and save the new assembly, and then delete yourself again.

+3
source
+2
source

Source: https://habr.com/ru/post/1736304/


All Articles