문제

So far, I was doing this to harvest files from single directory:

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

How can I harvest files from multiple directories into one .wxs file with HeatDirectory like below:

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

Is there some way to do it or do I need to have multiple HeatDirectory elements in my wixproject file?

도움이 되었습니까?

해결책

HeatDirectory (as its name implies) only harvests one directory (and optionally its children) at a time. To harvest two directory roots, you'll need two HeatDirectory elements. You'll also need to output two different .wxs files otherwise one harvest action will overwrite the other's output file.

다른 팁

Refer to @Farrukh Waheed comment, you can do something like below:

  <ItemGroup>
    <HarvestDirectory Include="../Project1">
      <DirectoryRefId>Ref1</DirectoryRefId>
      <ComponentGroupName>Component1</ComponentGroupName>
    </HarvestDirectory>
    <HarvestDirectory Include="../Project2">
      <DirectoryRefId>Ref2</DirectoryRefId>
      <ComponentGroupName>Compoenent2</ComponentGroupName>
    </HarvestDirectory>
  </ItemGroup>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top