我正在使用heat.exe来生成文件列表,我需要替换File / @ Source =“SourceDir” 所以我传递了-var和目录名,但是这些变量是在我的.wxi文件中定义的 如何在生成的热量生成的wxs文件中包含.wxi文件。因为每次我进行构建时都会生成此文件。
答案 0 :(得分:1)
为什么要替换SourceDir?
您可以使用-b
开关传递其他基本文件夹,对于SourceDir的所有引用,WiX将查看您指定的基本文件夹。可以轻松地在机器之间移动,只需更新构建系统中的参数,而不是编辑包含文件。
答案 1 :(得分:1)
wix 3.7的更新,当您在wixproj中使用HeatDirectory任务而不是运行heat.exe时,您可以使用PreprocessorVariable来设置SourceDir。
<Target Name="BeforeBuild">
<HeatDirectory Directory="..\distribution"
PreprocessorVariable="myVar" <--- your variable name
OutputFile="HeatGeneratedFileList.wxs"
ComponentGroupName="HeatGenerated"
DirectoryRefId="INSTALLFOLDER"
AutogenerateGuids="true"
ToolPath="$(WixToolPath)"
SuppressFragments="true"
SuppressRegistry="true"/>
</Target>
更多细节:
http://wix.sourceforge.net/manual-wix3/msbuild_task_reference_heatdirectory.htm