Why does Windows 7 install 64 bit apps in the Program Files (x86) folder? Can I change the behaviour?

Solution 1:

The reason for this is simply many older installers either do not understand the new file structure and plonk everything in the standard program files directory or you are looking at a smart program that has a few 32-bit components which are being copied there.

Your best bet is to download a new program - such as x64 Winrar and just see where it installs to just to rule out a problem with your machine.

As for messing stuff up - it can, but it really depends on the program, there is no one answer fits all... some smaller, compact programs with just a few files should have no problem, where as, if you talk about Office, Adobe or any other "suite" or large program, it will most likely fail as they have many shared components that are cross architecture.

Solution 2:

If you use anything other than %ProgramFiles% (or CSIDL_PROGRAM_FILES, or under .NET Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)) you're in trouble anyway, since custom installations can have programs installed under other volumes (D: for instance) and international installations often have other folders by default.

  • Spanish Windows: C:\Archivos de Programa,
  • French Windows: C:\Programmes,
  • German Windows : C:\Programme,
  • Swedish Windows: C:\Program

etc.

Solution 3:

Please note that under 64-bit versions of Windows 7 (this may also apply to other newer OS versions as well, but I can only confirm this for Win 7 64-bit) there is a difference between the aparent location of your %ProgramFiles% in explorer and in DOS.

Under windows 7 the actual physical folder location of %ProgramFiles% (and the associated %ProgramFiles(x86)% environemnt variable) is fixed as per the English version; i.e. "C:\Program Files" and "C:\Program Files (x86)" respectivley, but is shown in exploer localised as appropriate.

To provide a specific example; on a Swedish Windows 7 64-bit install, if you open Explorer and look in the system drive (typically C:) you see "Program" and "Program (x86)" folders. Typing %ProgramFiles% into the address bar moves you into "C:\Program".

However if you open a DOS box and type SET you will see that the actual value of %ProgramFiles% is "C:\Program Files" not the "C:\Program" folder exploer shows you. Further exploring with CD and DIR you can see it physically is "C:\Program Files"

The moral is if you use the environment varaibles or program via the API's everything will still work, but be aware of this subtle change when exploring the file system!