【发布时间】:2014-12-03 21:09:48
【问题描述】:
我使用_PublishedApplications 在 TFS 构建服务器中生成结构。在此之后,我使用 WiX 项目中的<HeatDirectory> 来正确获取 _PublishedApplications 文件夹的内容。但我的问题是构建期间的顺序。
如果我在<Target Name="BeforeBuild"> 中使用<HeatDirectory>,它不包括复制到_PublishedApplications 的二进制文件,因为收集是在发布(文件复制)之前执行的。
如果我将目标更改为BeforeCompile,则编译不会成功,因为首先没有文件。这是 WiX 项目的代码(它的相关部分):
<ItemGroup>
<Compile Include="Product.wxs" />
<Compile Include="Autogenerated.wxs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SimpleProject\SimpleProject.csproj">
<Name>SimpleProject</Name>
<Project>{GUID}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>Binaries</RefProjectOutputGroups>
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
</ProjectReference>
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
<Target Name="BeforeCompile">
<HeatDirectory OutputFile="Autogenerated.wxs" Directory="$(Sources)"
PreprocessorVariable="var.SimpleProject.TargetDir"
AutogenerateGuids="true" SuppressRegistry="true"
ToolPath="$(WixToolPath)" DirectoryRefId="INSTALLFOLDER"
ComponentGroupName="ComponentGroup_Core"
SuppressRootDirectory="true" />
</Target>
问题
在将二进制文件复制到 _PublishedApplications 后如何执行收集?
【问题讨论】: