使用 HeatDirectory 从 wix 中的多个目录中获取文件

问题描述 投票:0回答:2

到目前为止,我这样做是为了从单个目录中获取文件:

<HeatDirectory DirectoryRefId="INSTALLFOLDER" OutputFile="references.wxs" 
  Directory="../MyProject/reference1" ComponentGroupName="ref1" 
  ToolPath="$(WixToolPath)" PreprocessorVariable="var.ref1" 
  AutogenerateGuids="true">
</HeatDirectory>

如何使用 HeatDirectory 将多个目录中的文件收集到一个 .wxs 文件中,如下所示:

<HeatDirectory OutputFile="references.wxs" 
  Directory="directory1_Path|Directory2_Path|...." ComponentGroupName="ref1" 
  ToolPath="$(WixToolPath)" AutogenerateGuids="true">
</HeatDirectory>

是否有某种方法可以做到这一点,或者我是否需要在我的 wixproject 文件中包含多个 HeatDirectory 元素?

c# visual-studio-2010 wix installation heat
2个回答
9
投票

HeatDirectory
(顾名思义)一次仅收获一个目录(以及可选的子目录)。要获取两个目录根,您需要两个
HeatDirectory
元素。您还需要输出两个不同的
.wxs
文件,否则一个收获操作将覆盖另一个的输出文件。


0
投票

参考@Farrukh Waheed 评论,你可以执行如下操作:

  <ItemGroup>
    <HarvestDirectory Include="../Project1">
      <DirectoryRefId>Ref1</DirectoryRefId>
      <ComponentGroupName>Component1</ComponentGroupName>
    </HarvestDirectory>
    <HarvestDirectory Include="../Project2">
      <DirectoryRefId>Ref2</DirectoryRefId>
      <ComponentGroupName>Component2</ComponentGroupName>
    </HarvestDirectory>
  </ItemGroup>
© www.soinside.com 2019 - 2024. All rights reserved.