12
votes

I have a Wix project from which I would like to install 32-bit drivers when built with the x86 release configuration and 64-bit drivers when built with x64.

The way I am doing this just now is with two identical projects but one referencing difxapp_x86 and the other referencing difxapp_x64. Can I improve on this?

Also, if I reference difxapp_x86 and build the 64 bit version, then unsurprisingly I get the msi error:

"DIFXAPP: ERROR - You need to use the 64-bit version of DIFXAPP.DLL to install drivers on this machine."

Is it possible to reference these conditionally based on the selected build configuration?

Thanks, Alan

1
I am getting the same error too. Instead of using DIFXAPP, a custom action that simply calls SetupCopyOemInf and does some error handling should allow you to make one installer for both 32-bit and 64-bit Windows (I have done that successfully many times, just not with WiX).David Grayson

1 Answers

17
votes

I managed to find a solution to this which involved manually editing the project file.

I changed the following part:

<ItemGroup>
  <WixLibrary Include="difxapp_x86">
    <HintPath>C:\Program Files\Windows Installer XML v3.5\bin\difxapp_x86.wixlib</HintPath>
    <Name>difxapp_x86</Name>
  </WixLibrary>
</ItemGroup>

To the following:

<ItemGroup>
  <WixLibrary Include="difxapp_$(Platform)">
    <HintPath>C:\Program Files\Windows Installer XML v3.5\bin\difxapp_$(Platform).wixlib</HintPath>
    <Name>difxapp_x86</Name>
  </WixLibrary>
</ItemGroup>

Now the path to the reference will be determined by state of the Platform variable. Hope it helps others with the same requirement.

Alan