Windows 7 64-bit programfiles environment variable
Yes, Windows automatically maps folder and file access to c:\program files
for 32-bit programs to c:\program files (x86)
. Visual Studio as well as MSBuild are 32-bit programs. Same is true for c:\windows\system32 vs c:\windows\syswow64.
Comments
-
PhilBrown over 1 year
Does anyone know if windows 7 will somehow defer back to the "ProgramFiles(X86)" environmental variable when the "ProgramFiles" variable is used?
We have a situation where a developer is using visual studio and the proj file references assemblies using "$(ProgramFiles)". The machine is 64-bit and the "ProgramFiles" variable points to "C:\Program Files", however the assemblies are in "C:\Program Files (X86)" yet the project builds. It does not build if the literal "C:\Program Files" path is used. The compiler says it cannot find the assemblies
-
PhilBrown over 13 yearsThank you. That's what I thought.
-
Keith Hill almost 12 yearsI don't think this is true except for the use of the environment variable %ProgramFiles% which does automatically provide the correct path depending on the bitness of the process. The reason the OP's situation works is because VS is 32-bit and
$(ProgramFiles)
refers to the environment variable %ProgramFiles% which will beC:\Program Files (x86)
for a 32-bit process on a 64-bit OS. If I fire up a 64-bit exe inC:\Program Files\Acme\foo64.exe
from a 32-bit process the OS just switch the path on me toC:\Program Files (x86)\Acme\foo64.exe
.