views:

1341

answers:

5

Is it acceptable to install an application in the AppData folder? Both Google Talk & Chrome are not installed in the default Program Files folder. They get installed in user's AppData folder. Microsoft does the same thing with ClickOnce...

I would like to my application to self-update, but when installed in Program Files folder, it fails. Under Windows Vista (2008 and Seven), an application cannot write in Program Files folder. I understand that UAC is the responsible, but it prevents my application to self-update.

In case I would like to deploy in the AppData Folder to work around security issues, how do I tell my MSI Setup Project to install in AppData? Any idea?

Thanks!

UPDATE: I cannot use ClickOnce since it requires a certificate. I don't want to spend 200$/year for a certificate.

+1  A: 

You are mistaken about a key point:

I understand that UAC is the responsible

This is not true. The same rule applies in XP if you are running as a standard user, which is the case in many corporate environments. It's not UAC the prevents this: it's the way windows sets up permissions on the folder, and it's by design.

You sort of answerd your own question: if you want to install to the AppData folder, just a use a ClickOnce installer.

Joel Coehoorn
ClickOnce forces the use of certificate. I can't afford a 200$/yr for a Cert...
Martin
can you use a self signed certificate?
sascha
+1  A: 

What self updating framework are you using?

One of the original goals of ClickOnce is to be a non-impactful install method. The install is little more than an XCOPY and is virtually guaranteed to not mess with the rest of the system. This is part of the reason MS chose AppData over Program Files. It is much less likely that you will corrupt the overall system if you only write files into AppData.

If your custom framework wants to be self updating and also have a single user, low impact install, AppData might not be a bad choice. Really anything under the Users directory is a better place than Program Files.

JaredPar
A: 

True but i have observed a very strange behavior on Vista, i have used appdatafolder property in my msi and it requires administrator privileges to get installed, now when uac is on and standard use runs the application , uac shows the login box and ask for administrator password when we provide the same application get installed but not in app data folder of standard user it get installed in Administrator app data folder.

+3  A: 

clickonce delployments can be unsigned from VS 2008 onwards

+1  A: 

In Windows 7, the new MSI 5.0 supports true "per-user" installs that don't require UAC elevation -- there is now a per-user Program Files directory. Here's the PDC talk for more info:

http://channel9.msdn.com/pdc2008/PC42/

William Leara
Doesn't really help since presumably OP wants the app to work on XP and Vista.
jeffamaphone