Search code examples
wixwindows-installer

Wix Toolset - How do I add platforminstaller property to my .wixproj


Environment:
Visual Studio 2019 WPF .Net Framework 4.8
Wix Toolset - latest version
Link to article

I'm trying to mark my components to be 64-bit and according to article below there are 2 "easy ways".

  1. Use -arch on command line. I'm using Visual Studio that automatically runs candle.exe. Is there a way to add through Visual Studio?
  2. Use InstallerPlatform property in .wixproj. I unload the .wixproj and then edit it but I have no idea where and how to specify this property.

enter image description here


Solution

  • There must be something better than this (perhaps Chris Painter shows up - he is the apex build automation guy), but here goes with some pragmatic tweaks:

    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
      <OutputPath>bin\$(Configuration)\</OutputPath>
      <InstallerPlatform>x64</InstallerPlatform>
      <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
      <DefineConstants>Debug;</DefineConstants>
    </PropertyGroup>
    
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
      <OutputPath>bin\$(Configuration)\</OutputPath>
      <InstallerPlatform>x64</InstallerPlatform>
      <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath> 
    </PropertyGroup>
    

    I am not sure if Votive (WiX component in Visual Studio) will preserve this value or if it might get removed as you work.

    Hence using candle.exe and light.exe manually could be safer - I am not sure. I don't have this particular use-case right now:

    "%WIX%bin\candle.exe" product.wxs -arch x64 -ext WixUIExtension >> Build.log 
    "%WIX%bin\light.exe" -out Test.msi product.wixobj -ext WixUIExtension >> Build.log