2015-12-02 48 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>