views:

867

answers:

1

I know there have been a ton of questions about how to implement automatic updates in a .NET application, and I've probably read most of them. Unfortunately, none I have seen quite fit my situation as far as I can tell.

I am trying to build a self-updating .NET application that will run in an environment with limited user accounts. No admin rights here. The application must run on Vista and XP, and probably Win 7 when it comes out. An X-copy deployment would be fine. I would prefer NOT to use click-once

So far I have tried a system where the application checks a manifest and downloads updated binaries, which worked great in development, but not so much when the app was installed. Vista refuses to to let me copy files to Program Files. After that, I tried downloading an updated .msi, which works except that the MSI has a UAC prompt -- no go if the user does not have an account with local admin privileges.

Some posts have suggested that running the program in AppData and using the x-copy method might work, but I have not seen anyone say that they have tried it and it did work. Will that work for an account without admin rights? Can anyone vouch for this method before I start writing more code?

+1  A: 

You do just need to make sure that you're 'installing' (i.e. copying to) a location which non-privileged users have access to.

There's nothing magic about Program Files except that a non-privileged user can't write to it (by default).

If you have an admin do your initial install, then you could change the permissions on your program files folder so that subsequent upgrades could overwrite those files. But that's not really in the spirit of things.

The main disadvantages of ClickOnce are the uncommon install location and the primitive installer - if you're going to be doing xcopy to somewhere weird anyway, then you already have much of what's already icky about ClickOnce, without any of the advantages.

Will Dean