views:

650

answers:

2

I have an installer script written in Wix 2 several years ago. Now I need to add two 64-bit components. One 64-bit DLL to be copied to system32 folder and another b4-bit EXE to ProgramFiles.

The installer needs to create registry key. Currently it uses a element to write a key, and a custom action (in 32-bit MSI dll) to write the serial number.

The key must be accessible to 64-bit EXE.

Is it possible to do in one MSI? Also how to create a condition that only copies the 64-bit files when the system is 64-bit?

+1  A: 

msi doesn't allow installing 32-bit and 64-bit components in the same msi. You have to create a separate msi for both architectures.

Stefan
To be slightly more precise, it doesn't allow installing 64-bit components in a 32-bit MSI. It's willing to install both kind of component in a 64-bit MSI, but those will not run on a 32-bit system.
Michael Urman
+1  A: 

In order to install 64-bit components, the MSI needs to be marked as being 64-bit - otherwise, filesystem and registry paths will be redirected. As well as adding the 64-bit attributes, the 32-bit and 64-bit packages should appear as different products; i.e. you should create new Product and Upgrade codes.

I think there may be problems with using WiX 2 to create 64-bit MSIs, so you may need to upgrade to WiX 3.x.

Since you need two MSI files for 32-bit vs. 64-bit Windows, you can easily prevent 32-bit files being installed on a 64-bit PC by not including them in the 64-bit installer. If you need a single installer executable for both x86 and x64 you'll need to use a bootstrapper which chooses which MSI to run. I don't know if burn.exe from the WiX distribution can do this.

One way to approach the source layout is to use a single master WiX file with conditionals which select which features to build in depending on the target architecture, and then have architecture-specific modules which get linked in. You can find an example of such a solution at https://svn.bluestop.org/viewvc/repos/sctpDrv/wix/ . Note that it only supports x86 and x64 and not Itanium (aka Intel64).

BruceCran