Experimentation with WiX - a software toolset that builds Windows Installer packages from XML code
When your project contains many files to install, it can be quite cumbersome to create File and Component elements for all of them.
Instead, you can use a tool called heat.exe, which ships with the WiX toolset. This tool can process a directory (usually it will be your build output directory) and create a separate .wxs file that contains a list of your application files. This file can be then referenced by your main Product.wxs script.
In a real project, you would like to automatically harvest application files before every installer build. There are multiple ways to achieve it:
The HeatDirectory task wraps heat.exe and can be built in your .wixproj script.
If you generated your WiX project in Visual Studio, you'll find the following commented-out block in the very end of your .wixproject file:
<!--
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">
</Target>
<Target Name="AfterBuild">
</Target>
-->Just uncomment it and insert the following snippet into the BeforeBuild target:
<HeatDirectory Directory="RELATIVE_PATH_TO_DIRECTORY_TO_HARVEST"
PreprocessorVariable="var.HarvestPath"
OutputFile="OUTPUT_FILE_NAME"
ComponentGroupName="COMPONENT_GROUP_NAME"
DirectoryRefId="INSTALLFOLDER"
AutogenerateGuids="True"
ToolPath="$(WixToolPath)"
SuppressFragments="True"
SuppressRegistry="True"
SuppressRootDirectory="True"/>