OK, people these days like their applications to be portable, and store their configuration in the same folder as the exe.
But Windows Vista and 7 really don't like it if you have to save your configuration file back into any subfolder of Program Files, so normally you as a developer would just put in in %APPDATA%\program name, right?
All right, so when you are writing the installer (not every user wants to bother with zips), it seems you have a couple of choices:
1. Ask the user if (s)he wants a portable install or a regular install. If it is a portable install, store the settings in the same folder as the program. Otherwise, store the settings in the registry and %APPDATA%\program name
2. Just make the default install location C:\Tools\program name and store the settings in the same folder always. Keep things simple. Make it easy to copy to USB stick later if needed.
Either way, of course, the user can change the default install folder. I'm probably the only one with a folder called C:\Tools so an attentive user may want to change it to C:\Utilities or something. Or back to C:\Program Files which breaks my plan.
I've been leaning toward #2 for a while. Microsoft doesn't try to stop anyone from saving to C:\Tools so that bit of security by obscurity is bypassed. When I as a user install a program, if it's a zip file, C:\Tools is where it goes. If it's some random program and I suspect that the program uses an INI file instead of the registry, C:\Tools is where it goes.
This is learned behavior. Before Vista, I was conditioned to put everything in Program Files, even if the app came to me as a zip file. In Vista, if I tried this, the first time I needed to save settings back to an INI file inside a subfolder of C:\Program Files, it didn't even give a UAC prompt, it simply did one of these two things:
a. It would simply fail.
b. It would appear to work, but it was actually saving to file to a redirected location within my user profile. So I and seemingly the programs themselves had trouble finding the program settings because we had to look in both the real Program Files folder and the virtual Program Files folder within my user profile.
So what I used to do in Vista was
1. Make a note of the folder name the installer created
2. Uninstall the program
3. Make sure the program folder was still there and set the permissions so that I had permissions to write to it
4. Reinstall the program
This seems to be less of an issue with Windows 7, which is around the time I decided to install more programs in C:\Tools. If I put a file in one of the forbidden locations, I usually get a UAC prompt and it lets me continue. I haven't thought much about folder redirection since moving on to Windows 7, so either it has become more transparent, or it's because this is around the time I started installing things to the Tools folder more frequently. I'm curious now, I'll see if I can find the redirected folders on my main box (which runs Windows 7) when I get a chance. It's strange that I don't remember ever even seeing them in Windows 7.
(And yes, I know UAC and folder redirection can be turned off, but I never felt good about doing that.)
This is my most rambling post ever; basically I want to know what you folks think about install locations, should the installer ask the user if he wants it to be portable, or just install it somewhere like C:\Tools where it won't matter. Or is there a third (or fourth, or fifth) way?