Search code examples
c#windows-7windows-xpsetup-deployment

How do I best implement my Windows desktop and service C# applications automatic updates?


My project contains WinForms, WPF, and Windows Service programs running on users' office desktop PCs. I want these applications to periodically check for new versions available at specific URL, automatically download new versions and replace themselves with new versions without attracting any user attention (keeping in mind that users may run Windows from XP to 7 and work using non-privileged account (which can be part of active directory)). Alternatively the whole update package has to be able to be distributed as an unattended-installed MSI package.

Any recommendations on implementing this?


Solution

  • You are out of luck - sadly all solution suck. Your best bet (i.e. what I am doing) is have one application check whether it is out of date regularly and signal that to the user. Now, in my case "Wndows Service" means "with a user logged in on anothe computer pretty much all the time controlling the service", so I have someone to actually alert. If that does not work, you will have to reimplement something like the windows update service - there sadly is no predefined way to do that.

    No user attention does not work at all, btw. - installation / update of windows services will have to be done with adminsitrative rights, even if those come from the priviledges of a windows service making the updates. Dirty issue whatever you do that.

    I would go with an MSI - this way corporate users can roll that out via their software management (which can install priviledged), whatever they use there (there are multiple), and (home) end users just can install it with admin priviledges, like they do with every other software. Maybe do a web service call on every start checking for a new version on a central server.