2
votes

I have a WIX installer which needs to install files to two directories. In one directory we need to install a 32-bit version of the file, and in another, the 64-bit version.

However, the files have the same filename, which seems to cause WIX to merge them together and just store a single copy in the MSI.

Basically, I want the a directory structure similar to the following:

c:\Program Files\FooApp\MyLib.dll
c:\Program Files (x86)\BarApp\MyLib.dll

with the respective 32- and 64-bit versions of MyLib.dll.

The two files are currently in our .wxs file as separate File elements with separate ID's and stored as separate components. However, when I run the installer, it installs the 64-bit version of the file to both locations, and if I extract the contents of the MSI with Dark.exe, it also shows both components have the same Source attribute.

Is there a way to convince WIX to store both files independently and ensure they're each installed to the right directory?

1
Can you add the components that describe both these files to your question?Brian Sutherland
The Id of each File element just needs to be unique (and of course the Source :) )Peter Ritchie
It's not WiX you need to convince. It's Windows Installer.Christopher Painter
@PeterRitchie that's what I thought too, but the File elements do have different Id and Source attributes. It still ends up installing the same file to both.jalf

1 Answers

0
votes

While WiX does have a concept called "smart cabbing" that is done based on checksums.

The behavior you are seeing is due to a different reason:

Windows Installer doesn't support 32bit and 64bit components in a single installer. MSI databases are platform specific and the Windows Installer will work against you by "helping" you fix that C:\Program Files reference to point to the 32bit location it thinks you be deploying to as a 32bit MSI.

The "correct" solution is to create a 32bit msi and a 64 bit msi and bundle them together using a bootstrapper such as WiX Burn.

If you really don't want the complexity of an EXE bootstrapper and only have 1 file to deploy to 64bit program files folder there is a subversive hack. I have observed in years past that MSI isn't smart enough to figure out that C:\Progra~1 is in fact C:\Program Files and therefore it won't try to help you.

This little subversive hack has been useful when I need to deploy a file to both the 32bit and 64 MSBuild directory.

No promises on whether it'll work in the future... it's not documented by Microsoft.