Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I conditionally install a file with WiX based on the target machine (32bit or 64bit)?

I have a file that has a 32bit version and a 64bit version. If I install my application on a 32bit machine, I want the 32bit version of the file to be installed. Likewise, the 64bit version should get installed if the installation is run on a 64bit machine. How do I check which type of machine the installer is being run on with WiX?

Please, no one-line answers. I'm looking for specific WiX tags and where to put them in my WiX script.

like image 214
Everett Avatar asked Apr 08 '09 15:04

Everett


2 Answers

You could probably just do two separate components, using the conditions

 VersionNT64

and

 Not VersionNT64

But the correct way is to compile separate installers for 32 and 64 bit OS's and 64-bit components should also be marked as such (with Win64="yes") - I don't know if it's even possible to mark a Windows Installer package as targeted towards both Intel and x64. Only time I've ever done a mixed architecture installation is with NSIS, all my WiX installers have separate installers for each architecture.

like image 153
saschabeaumont Avatar answered Sep 28 '22 01:09

saschabeaumont


The proper way of doing so is to compile two setups, one for 32 (x86) and one for 64 (amd64). Then you package those two msi inside a single msi and run the appropriate one at runtime.

like image 45
Shay Erlichmen Avatar answered Sep 28 '22 02:09

Shay Erlichmen