Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I have created a window service using C#.NET and want to create its automatic updater service. My service will be installed from my custom msi windows installer. I start browsing and found wybuild is tool which will help you to do so, but will work only with services installed as LocalSystem.

Here my window service will run under context of a user credentials.

These are my queries, if I think of creating it manually -

1) Is there any other package available to do this task?

2) If I will develop this updater service manually, How I need to proceed? Like one major query I have is - Should Uninstall and install service from scratch so that will have proper version when I will try to uninstall it from Program and Feature. Or should I just replace files and start service? Will this create any issues in versioning, when I will try to uninstall it from Program and Feature?

3) On server how files should be placed, zip or normal. If zip, what if any errors came while extracting or something?

Like these kind of 'n' number of issues I am worried about.

Any help.

Thanks
Posted
Comments
Zoltán Zörgő 3-Jul-12 3:30am    
Simplest way (not applicable in complex dependency cases) stop the service, replace assamblies that need to be replaced and restart the service. This won't cause problems when uninstalling only if you change file names, add files. In other cases you should uninstall the previous version, but don't forget not to delete configuration, and upgrade configuration if needed. You can interact with MSI service from code, but you also can install or uninstall service from code.
sunder.tinwar 3-Jul-12 4:28am    
thanks for reply, I know that if I stop service replace exe and dlls and start service app will work great. But only doubt I had is I installed version 1.0.0.0 from MSI installer and updated exe and dlls to version 1.0.0.1. When I try to uninstall it from program and feature will it work? Still have that doubt
Zoltán Zörgő 3-Jul-12 4:57am    
The installer is not dealing with assambly versions. The installer itself publishes it's own version, and that is linked with product GUID (kind of). Of course, by replacing the files only, the system will not know about the version change. You can alter it in the registry if you want. Look here: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
sunder.tinwar 3-Jul-12 5:01am    
how the files on server should be? In zip or what? and what if any error while extraction?
Zoltán Zörgő 3-Jul-12 5:36am    
If you have bandwidth, you can even copy files one-by one. But having a store-level zip is giving you more consistency.
But: there is a toolset in .net that might be considered: ClickOnce [see: 1, 2, 3] - but it is not for services...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900