Wix:多个目录的HarvestDirectory目标

时间:2014-09-19 12:40:14

标签: msbuild wix

我正在尝试在* .wixproj文件中收集不同的文件夹。但是HeatDirectory任务只是收获了最后一个HarvestDirectory目标。我在这里缺少什么?

这是我的代码段:

 <ItemGroup>
    <Compile Include="Components.wxs">
      <Link>Components.wxs</Link>
    </Compile>
    <Compile Include="Product.wxs" />
  </ItemGroup>
  <ItemGroup>
    <HarvestDirectory Include="$(SolutionDir)\WebApplication2\bin\$(Configuration)">
      <AutogenerateGuids>true</AutogenerateGuids>
      <ComponentGroupName>SimpleWebAppGroup</ComponentGroupName>
      <DirectoryRefId>INSTALLFOLDER</DirectoryRefId>
      <SuppressCom>true</SuppressCom>
      <SuppressRegistry>true</SuppressRegistry>
      <PreprocessorVariable>var.SourceDir</PreprocessorVariable>
     <Visible>false</Visible>
    </HarvestDirectory>

    <HarvestDirectory Include="D:\testing\TTSVN\Program Files\TortoiseSVN\Common\TortoiseOverlays">
      <AutogenerateGuids>true</AutogenerateGuids>
      <ComponentGroupName>SVNOverLays</ComponentGroupName>
      <DirectoryRefId>PROGFILES</DirectoryRefId>
      <SuppressCom>true</SuppressCom>
      <SuppressRegistry>true</SuppressRegistry>
      <PreprocessorVariable>var.SourceDir</PreprocessorVariable>
      <Visible>false</Visible>
    </HarvestDirectory>
  </ItemGroup>
  <Import Project="$(WixTargetsPath)" />
  <Target Name="BeforeBuild">
    <HeatDirectory NoLogo="$(HarvestDirectoryNoLogo)"
                   SuppressAllWarnings="$(HarvestDirectorySuppressAllWarnings)"
                   SuppressSpecificWarnings="$(HarvestDirectorySuppressSpecificWarnings)"
                   ToolPath="$(WixToolPath)"
                   TreatWarningsAsErrors="$(HarvestDirectoryTreatWarningsAsErrors)"                       TreatSpecificWarningsAsErrors="$(HarvestDirectoryTreatSpecificWarningsAsErrors)"
                   VerboseOutput="$(HarvestDirectoryVerboseOutput)"
                   AutogenerateGuids="$(HarvestDirectoryAutogenerateGuids)"
                   GenerateGuidsNow="$(HarvestDirectoryGenerateGuidsNow)"
                   OutputFile="Components.wxs"
                   SuppressFragments="$(HarvestDirectorySuppressFragments)"
                   SuppressUniqueIds="true"
                   Transforms="%(HarvestDirectory.Transforms)"
                   Directory="@(HarvestDirectory)"
                   ComponentGroupName="%(HarvestDirectory.ComponentGroupName)"
                   DirectoryRefId="%(HarvestDirectory.DirectoryRefId)"
                   KeepEmptyDirectories="false"
                   PreprocessorVariable="%(HarvestDirectory.PreprocessorVariable)"
                   SuppressCom="%(HarvestDirectory.SuppressCom)"
                   SuppressRegistry="%(HarvestDirectory.SuppressRegistry)"
                   SuppressRootDirectory="$(HarvestDirectorySuppressRootDirectory)"
                   >

    </HeatDirectory>
  </Target>

如果我省略HeatDirectory任务,它肯定不会更新Component.wxs。我没有找到任何显示使用HarvestDirectory和HeatDirectory任务的示例。虽然Wix documentation显示HarvestDirectory目标将HarvestDirectory项目传递给HeatDirectory任务以从文件生成创作。

任何帮助都会非常感激。

1 个答案:

答案 0 :(得分:0)

我删除了HarvestDirectory项目,现在使用两个HeatDirectory任务,同时生成两个单独的wxs文件,同时在Compile中进行链接。这解决了这个问题......