Page 1 of 1

Portable and Non-Portable in the same program

Posted: Mon Mar 21, 2011 11:45 am
by flector
Every now and then, someone will try to install a portable program into C:\Program Files\SomeProgram. On Vista and Win7, that is a bad idea because it takes elevated privileges to write to that folder.

I wonder if it would be useful to provide the option of writing configuration files to %AppData%\SomeProgram instead of the folder the .exe file is located in...

Re: Portable and Non-Portable in the same program

Posted: Mon Mar 21, 2011 12:42 pm
by SYSTEM
Why not put the program itself into %AppData%\SomeProgram?

Re: Portable and Non-Portable in the same program

Posted: Mon Mar 21, 2011 2:02 pm
by JohnTHaller
The best option is for the portable installer or the application (or launcher if it uses one) to inform the user of the error on launch. Many of our apps test for write access on launch automatically and will inform the user if they fail. We'll be adding bits to our portable installers to warn users of the issues of using Program Files for portable software (due to these issues plus the fact that many apps detect when they are in Program Files and assume they are locally installed). For users wanting to run locally, we recommend installing apps to C:\PortableApps\. That way if they move later, it's just as easy to just move that folder to a new drive internal or external.

Re: Portable and Non-Portable in the same program

Posted: Mon Mar 21, 2011 2:26 pm
by flector
I like the idea of testing if the app is running from CSIDL_PROGRAMS and putting up a warning dialog when needed.

Re: Portable and Non-Portable in the same program

Posted: Tue Mar 22, 2011 12:09 am
by m^(2)
I think that app should just work. That is - the installer should ensure all rights that it requires are in place.

Re: Portable and Non-Portable in the same program

Posted: Tue Mar 22, 2011 10:13 am
by JohnTHaller
m^(2): I don't think an installer can alter Vista/7's requirement that you must show a UAC prompt to alter anything in Program Files, so things installed to Program Files can't just work. Or did you mean the installer or launcher or app should warn you when it can't work?

Re: Portable and Non-Portable in the same program

Posted: Tue Mar 22, 2011 11:05 am
by m^(2)
Are you sure about it?
I know of some program that writes in it's own folder and installation directory used to point to program files, yet I don't see users screaming. I remember such things soon after Vista arrived. Installer was modified to alter directory permissions and it worked.
It may have been modified to install elsewhere or store settings elsewhere with the advent of Vista 2, but I think I would notice. I don't use the program, but I'm a moderator of it's forum.