2015-12-02 47 views
1

PreBuildEventHeatDirectory之间的关系是什么 .wixproj文件?PreBuildEvent vs HeatDirectory中的WiX .wixproj文件

要调用heat.exe我已经配置了一个预生成事件:

<PropertyGroup> 
    <PreBuildEvent>"$(WIX)bin\heat.exe" dir "$(SolutionDir)\Source"^
         -var var.SourceDir^
         -dr INSTALLFOLDER^
         -cg MyComponents^
         -ag -ke -scom -sfrag -srd -sreg -suid -svb6^
         -o "$(ProjectDir)MyComponents.wxs"</PreBuildEvent> 
    </PropertyGroup> 

但是也有个HeatDirectory元素:

<!-- To modify your build process, add your task inside one of the 
    targets below and uncomment it. Other similar extension points 
    exist, see Wix.targets. 
<Target Name="BeforeBuild"> 
    <HeatDirectory ... > 
    </HeatDirectory> 
</Target> 
<Target Name="AfterBuild"> 
</Target> 
--> 

是什么关系,哪一个我应该使用?

回答

1

两者都是一样的。

Prebuild事件直接调用加热过程以便自动生成MyComponents.wxs文件。

和之前的构建目标在使用“HeatDirectory”或“HarvestDirectory”时相同。

主要区别在于哪个选项更适合您。 命令行,如您如上所述,或XML样式,如:

<HarvestDirectory Include="$(SourceDir)"> 
    <DirectoryRefId>INSTALLDIR</DirectoryRefId> 
    <ComponentGroupName>cmpMain</ComponentGroupName> 
    <PreprocessorVariable>var.SourceDir</PreprocessorVariable> 
    <SuppressUniqueIds>false</SuppressUniqueIds> 
    <SuppressCom>true</SuppressCom> 
    <SuppressRegistry>true</SuppressRegistry> 
    <SuppressRootDirectory>true</SuppressRootDirectory> 
    <KeepEmptyDirectories>false</KeepEmptyDirectories> 
    <Transforms>DefaultTransform.xsl</Transforms> 
    </HarvestDirectory>