How to install different files based on the Operating System (32/64-bit)?

When distributing a mixed 32/64-bit package, the application installed by the package may use a 32-bit or 64-bit version of the same file. In this How-To, the package must install a 32-bit version or a 64-bit version of the C:\Program Files\Your Company\Your Application\MyApp.exe file.

Windows Installer does not support duplicate files in the same folder. However, you can try this workaround:

  1. create a new Advanced Installer project (or you can use an existing one)
  2. go to the Files and Folders page
  3. add the 32-bit "MyApp.exe" file in "Application Folder"
  4. right-click the file and select the "Go to component" context menu or press the F8 key to go to the component of the file in the Organization page
  5. in the Component Properties pane set the Condition field to: NOT VersionNT64
  6. go to the "Files and Folders" page
  7. create a new folder under "Application Folder"
  8. right-click it and select the "Properties" menu (or you can double-click it)
  9. in the Properties tab of the "Edit Folder" dialog check the Install folder content into the parent folder option
  10. add the 64-bit "MyApp.exe" file in this custom folder
  11. right-click the file and select the "Go to component" context menu or press the F8 key to go to the component of the file in the Organization page
  12. in the Component Properties pane set the Condition field to: VersionNT64

The Install folder content into the parent folder option will make sure that the file in the custom folder will also be installed in "Application Folder". The mutually exclusive conditions of the files will make the package install only one of the two files on the target machine.

ImportantThis approach can be used for any file in your project.

NoteWhen using multiple files you can use two features, one for 32-bit files and one for 64-bit files. For this features you can set conditional installation levels based on the VersionNT64 property.