How do I always install some resources in the "C:\Program Files" path, regardless the platform?

ImportantThe following article uses options that are available starting with the Professional edition and project type.

When a 32-bit application writes or reads a value under the C:\Program Files\ directory , the application reads from the C:\Program Files (x86) directory on a 64-bit operating systems.

Their 32-bit counterparts are resolved to redirected locations as follow:

  • ProgramFilesFolder - C:\Program Files (x86)\
  • CommonFilesFolder - C:\Program Files (x86)\Common Files\
  • SystemFolder - C:\Windows\SysWOW64\

This is the default behavior of Windows Installer. A 32-bit installation package, on 64-bit machines, cannot install resources into 64-bit locations. For details, please check the package type article.

The correct approach is to select the Mixed 32/64-bit matching the platform option in the Install Parameters page. This way, the package runs as a 32-bit package on 32-bit systems and as a 64-bit package on x64 systems.

The .MSI does not support mixed package type, thus the package type will be turned into an .EXE package type. The .EXE bootstrapper built by Advanced Installer is a 32 bit one, this contains the x86 and x64 MSI files as well as the files to be installed from the CAB. When launched the EXE checks for the operating system architecture and it launches the correct MSI.

For 64-bit operating systems, place the files in the Program Files 64 folder from the Files and Folders page. The Program Files 64 folder has the ProgramFiles64Folder property attached which is only resolved on 64 bit machines to the C:\Program Files\ path.

For 32-bit operating systems, place the files in the Program Files folder. The Program Files folder has the ProgramFilesFolder property attached which is resolved on 32 bit machines to the C:\Program Files\ path.

The folders in the Files and Folders page use predefined and custom installer properties which store their paths. For details, check the Paths of the folders in the "Files and Folders"article.

ImportantIf the same source of the file is specified, the file will not be added twice, it will be added once so the package size will not increase.