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.
Asked
Active
Viewed 3,648 times
2 Answers
1
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

Community
- 1
- 1

laishiekai
- 841
- 1
- 13
- 26
1
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.

saschabeaumont
- 22,080
- 4
- 63
- 85
-
When you have multiple folders, with the same filename, the SourceDir is a nightmare. – Brain2000 Sep 26 '18 at 00:05