Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update an installed Windows service?

I have written a Windows service in C#.

I have since installed it on my machine, and it runs just fine.

When you install a service, does the exe get copied somewhere? Or does it point to my bin folder?

This is for me to know that when I update my code from time to time, do I have to uninstall and re-install my service to update it?

like image 750
shenku Avatar asked Mar 04 '14 03:03

shenku


People also ask

How do I update Windows 7 service pack?

Select the Start button > All programs > Windows Update. In the left pane, select Check for updates. If any important updates are found, select the link to view available updates. In the list of updates, select Service Pack for Microsoft Windows (KB976932) and then select OK.


1 Answers

If you want to update your Service automatically, you can use a framework such as Google Omaha. This is the technology which Google use to update Chrome. It works well with Services because it runs silently in the background, just like a Service. This article gives more information about using Omaha to auto-update a Service.

On the other hand, if you want to manually update your Service: If the Service's location has not changed and the name of its executable has not changed, you should not have to uninstall and reinstall it. You can simply stop the service with net stop, update its executable with a new version, and start it again with net start. This approach worked reliably for me for many months.

like image 143
J0e3gan Avatar answered Sep 29 '22 06:09

J0e3gan