views:

80

answers:

3

I am building a .NET based windows service. Part of its functionality is supposed to be checking if a newer version of itself is available on a site. It is then supposed to download the new "package" and somehow upgrade itself. Anyone know of any libraries that can help with that? I am assuming I will run into issues of overwriting the executable that is currently running.

Thanks!

A: 

If you want to get around the Vista UAC prompt you can have an admin service running on the local system acount and use this service to update the application.

  1. App checks for update and downloads it if required.
  2. If updates required run helper app (persists the permissions that the app was started with, if this is not an issue (e.g. don't mind app re-starting as admin) skip this step).
  3. Helper app calles admin service.
  4. Admin service stops app and updates it.
  5. Admin service calls helper app saying update complete.
  6. Helper app re-starts app.

We currently use this system on 2000, XP and Vista where users don't have to be administrators.

Stevo3000
A: 

Put most of the functionality in a class assembly and load it dynamically using a common interfaces assembly to share types. When the service first starts check for a new version and overwrite the existing one before loading it dynamically.

kenny