Search code examples
wixwix-extensionwix3.8

How to reference WixDifxAppExtension in a .wixproj file?


I am developing an installer for Windows using the WiX toolset. Instead of invoking the WiX tools directly, I created a .wixproj file and am using MsBuild to build it. My installer needs to install a driver, so I decided to try the Difxapp Extension.

The problem is that I don't know how to properly add the Difxapp extension in my .wixproj file. Inside the ItemGroup tag, I added <WixExtension Include="WixDifxAppExtension" /> and that causes MSBuild to add the argument -ext "C:\Program Files (x86)\WiX Toolset v3.8\bin\WixDifxAppExtension.dll" when it invokes Light.exe. However, I think I need to do something else, because I am getting the following error message:

error LGHT0094: Unresolved reference to symbol 'CustomAction:MsiProcessDrivers'

According to this thread from 2009, I need to add another argument to light.exe command, and that argument should be:

"$(WIX)bin\difxapp_x86.wixlib"

Does anyone have an example .wixproj they could share that shows how WixDifxAppExtension needs to be referenced? Alternatively, does anyone know how to just add an arbitrary linker argument? There must be a way.

Here is my current .wixproj file:

<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <ProductVersion>1.0.4</ProductVersion>
    <DefineConstants>ProductVersion=$(ProductVersion)</DefineConstants>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <ProjectGuid>{FACDEEA0-F843-4ca7-8FCC-09AFFFCAAE85}</ProjectGuid>
    <SchemaVersion>2.0</SchemaVersion>
    <OutputName>installer-$(ProductVersion)</OutputName>
    <OutputType>Package</OutputType>
    <DefineSolutionProperties>false</DefineSolutionProperties>
    <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <OutputPath>bin\$(Configuration)\</OutputPath>
    <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
    <DefineConstants>Debug;ProductVersion=$(ProductVersion)</DefineConstants>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <OutputPath>bin\$(Configuration)\</OutputPath>
    <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="installer.wxs" />
    <WixExtension Include="WixUIExtension" />
    <WixExtension Include="WixDifxAppExtension" />
    <!-- TODO: add  "$(WIX)bin\difxapp_x86.wixlib" -->
  </ItemGroup>
  <Import Project="$(WixTargetsPath)" />
</Project>

Solution

  • Add a WixLibrary item:

    <WixLibrary Include="difxapp_x86.wixlib" />