如何在引导程序中引用重命名的MSI?

时间:2015-09-10 23:06:17

标签: wix burn

在我的WIX设置(版本3.10)项目中,我使用下面的脚本重命名MSI。然后我在我的bootstrapper项目中引用这个安装项目:

<MsiPackage Id="MyMSI" SourceFile="$(var.Setup.TargetPath)" Vital="yes" />

这会导致编译错误。 Light.exe找不到输出文件:

error LGHT0103: The system cannot find the file 'X:\Setup\bin\x64\Release\Setup.msi'.

这是在编译之前成功重命名输出MSI的脚本:

<!-- Setup.wixproj -->
<Target Name="BeforeBuild">
    <GetAssemblyIdentity AssemblyFiles="$(SolutionDir)$(Configuration)\MyApp.exe">
      <Output TaskParameter="Assemblies" ItemName="AssemblyVersion" />
    </GetAssemblyIdentity>
    <CreateProperty Value="$(OutputName).$(Platform).Setup.%(AssemblyVersion.Version)">
      <Output TaskParameter="Value" PropertyName="TargetName" />
    </CreateProperty>
    <CreateProperty Value="$(TargetName)$(TargetExt)">
      <Output TaskParameter="Value" PropertyName="TargetFileName" />
    </CreateProperty>
    <CreateProperty Value="$(TargetDir)$(TargetFileName)">
      <Output TaskParameter="Value" PropertyName="TargetPath" />
    </CreateProperty>
    <PropertyGroup>
      <DefineConstants>BuildVersion=%(AssemblyVersion.Version)</DefineConstants>
    </PropertyGroup>
  </Target>

在Visual Studio 2013下进行编译。

0 个答案:

没有答案