I am using heat.exe to genrate file listing, I need to replace File/@Source="SourceDir" so I am passing -var and directory name , but those variable are defined in my .wxi file How can I include .wxi file in the heat generated wxs file . as this file will be generated each time i make a build.
5
votes
2 Answers
1
votes
Why replace SourceDir?
You can just pass in additional base folders to light with the -b
switch and for all references of SourceDir, WiX will look in the base folders you've specified. Makes it easy to move things around between machines and only have to update a parameter in your build system, rather than editing an include file.
1
votes
An update for wix 3.7, when you use HeatDirectory task in your wixproj instead of running heat.exe, you can PreprocessorVariable to set the 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>
More detail:
http://wix.sourceforge.net/manual-wix3/msbuild_task_reference_heatdirectory.htm