如何在.wixproj文件中引用WixDifxAppExtension?

时间:2014-05-23 01:21:30

标签: wix wix-extension wix3.8

我正在使用WiX toolset为Windows开发安装程序。我没有直接调用WiX工具,而是创建了一个.wixproj file并使用MsBuild来构建它。我的安装程序需要安装驱动程序,所以我决定尝试Difxapp Extension

问题是我不知道如何在我的.wixproj文件中正确添加Difxapp扩展。在ItemGroup标记内,我添加了<WixExtension Include="WixDifxAppExtension" />,这会导致MSBuild在调用Light.exe时添加参数-ext "C:\Program Files (x86)\WiX Toolset v3.8\bin\WixDifxAppExtension.dll"。但是,我认为我需要做其他事情,因为我收到以下错误消息:

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

根据this thread from 2009,我需要为light.exe命令添加另一个参数,该参数应为:

"$(WIX)bin\difxapp_x86.wixlib"

有没有人有他们可以共享的示例.wixproj,它显示了如何引用WixDifxAppExtension?或者,有没有人知道如何添加任意链接器参数?必须有办法。

这是我当前的.wixproj文件:

<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>

2 个答案:

答案 0 :(得分:3)

添加WixLibrary项目:

<WixLibrary Include="difxapp_x86.wixlib" />

答案 1 :(得分:1)

我刚刚将'difxapp_x86.wixlib'添加到'参考'中。 这消除了错误“对符号'CustomAction:MsiProcessDrivers'的未解析引用”。

相关问题