Preset install folder for Vista and Windows 7
From Bounce Metronome
In Vista, every program is expected to work with three different folders - the program location, the program initialisation files and the current folder for files saved by the user (all of which are separated further into per user and global locations).
This system existed already in XP but was optional to the extent that not many programs followed the model. In Vista the system is strongly enforced by the operating system.
It's recognised that many existing programs don't fit this model. So Vista deals with programs like this by creating a "virtual store" which contains the actual data for any files your programs attempt to save into your Program Files folder.
The files don't actually exist in your Program Files folder at all. However you see these files apparently in that location if you look at them using the Open and Save As windows within the program. The program itself also "sees" them there as well, e.g. if it checks if a file exists after saving into the install folder, then the Windows routine will report to the program that it exists even though it really only exists in the Virtual Store.
If you do a search of your hard disk or explore the folder for the program, you find that the files you saw in the Open and Save As windows don't exist there. You probably won't be able to find them anywhere unless you have switched on the option to show hidden system files, as the real virtual store is hidden in Vista and Windows 7.
This works well up to a point - users get the impression that they are able to modify the contents of the program folder and modify files there from within the program and so all goes well up to a point. But things aren't quite as they seem - and this on occasion can lead to confusion.
Disadvantages of relying on the virtual store for these programs include:
- If you search your hard disk for a file you just saved, you will often find that it isn't where you think it is. Normally you can't find it anywhere at all.
- A backup of the entire program folder can omit the files that only exist in the virtual store. E.g. if you just copy the folder using your Windows Files Explorer, the copy will not include any of the files from the virtual store.
- If you uninstall a program from Program Files, and then reinstall it into the same folder again, then all the old files "magically" reappear. That's because the uninstaller can't remove the copies of the files in the virtual store so they are still there after the uninstall.
- You can't do a clean uninstall then reinstall in Vista with UAC because of this "reappearing files" issue. The only way to do it is to reinstall into a different folder from the one you uninstalled from - or if you find and erase its virtual store before the reinstall.
- Files that are in the virtual store can't be started up by file association from within the program itself - because they aren't where they seem to be to the program.
These issues have arisen in support for my programs. They can puzzle users, and can be tricky to resolve. For some simple programs the Vista solution is fine but for mine it causes much puzzlement.
It is best to avoid this whole situation if one can. One solution of course is to switch off User Account Control. This works because it is UAC which is responsible for maintaining the Virtual Store. Many however will want to keep it on for its extra layer of protection from malware. And I would want to recommend that it is kept switched on as well.
I have been unable to find any recommended folder for such programs in the Microsoft documentation. But I have found out that some other legacy installers install into:
c:\Programs
That seems as good a preset as any for an "unofficial" standard.
Other programs that follow this single folder type model install directly into Drive C but that could lead to a proliferation of sub folders of the root C making navigation potentially confusing. So - though not perhaps ideal, c:\Programs seems perhaps the best alternative I can find so far.
An alternative some users may prefer is be to create a Programs sub folder of your My Documents folder. Some programs do use My Documents for things that rather stretch the notion of a document. E.g. Microsoft itself uses My Documents as the folder for Virtual Machines for Virtual PC.
I have considered other alternatives but not come up with anything convincing yet. A rewrite of the programs to follow the Vista model was one option I explored briefly. However the single folder type model has advantages for small programs especially if you want the program folder contents to be accessible to the user. It means everything the program modifies is in one place - rather than proliferating throughout your system in 3 or more different locations.
For the type of programs I write, these advantages seem to outweigh the disadvantages, so even with new programs I still use this simpler all in one folder type approach.
