2

The purpose of this is to have the default "program files" (32 and 64 bit) folders located under an arbitrary path, possibly on a drive separate from where windows lives.

Initially I thought that this may be done using a system environment variable through the dialog located under Control Panel -> System -> Advanced -> Environment Variables. These variables turned out to be set in the registry under the key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion. However, one particular entry is confusing. The ProgramFilesPath entry seems to point at an environment variable that is not defined under the same registry key.

I could assume that the difference between ProgramFilesDir and ProgramFilesPath is none and that one of them exists as a backwards compatibility, but having some legitimate resource from Microsoft to look at would be better than guessing.

After receiving some worrying feedback about having both 32 and 64bit applications in the same folder, I have decided not to ask about the feasibility of this to avoid discussion.

The real question is if the desired effect is possible to attain by "cutting into" the windows setup process and modifying those registry entries as early as possible. These settings should be system wide and not only for software installed by a particular user. If this is indeed something that can be done, I wonder if there are any subtle pitfalls.

Programs that expect libraries and other resources to be in default locations can probably be dealt with using the same technique as employed by Windows to re-map the "Documents and Settings" folders and the like (i.e. breaking legacy applications is not real concern).

1 Answers1

0

Yes, changing the variable should cause new programs to default to the new folder, but it also causes Windows (and any—properly coded—program that uses the variable) to look in the new folder for programs in general. As a result, it will break the software that is already installed to at least some degree.

Depending on the software, paths to them may or may not be hard-coded during installation. If they are not hard-coded and use the variable, then the program(s) will not be found anymore. If they are hard-coded, then they will (or at least should) continue to run, but other side-effects may/will manifest such as Windows and other programs that perfom operations on installed programs (like cleaning up temp-files, scanning for updates, etc.) may or may not be able to see them depending on how they are coded.

The point is that it is best to change the variable before or during (or at most, immediately after) installing Windows. Doing so later on, especially after having already installed programs (particularly large programs that dig deep into the system like most Microsoft programs) is a bad idea and fraught with risk.

(Actually, while the very point to using variables is to make it easier to make changes, the fact is that it is always risky to make changes to paths like Program Files and Windows no matter when you change it, because some programs—Windows included—will inevitably have a piece of code that expects things to be in a specific place, and will thus get broken if you change it.)

Synetech
  • 69,547