Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you include a generated file to a WiX project without adding it as an existing file

We use HEAT to build a file for our web project installer. I want to know if there is a way that I can have the file included in the compilation, but not included in the project.

The reason I need this is I would like to not check the file in on our source control, but have it build when we build the wixproj. Otherwise we have to hijack/checkout the file in order to reliably build the project.

like image 925
Spence Avatar asked May 10 '13 03:05

Spence


1 Answers

If you are using MSBuild and a .wixproj to build your .MSI then you will need to get the output from HEAT to be listed in a Compile item in the .wixproj. If the file is not included it will not get compiled into the final .MSI.

Fortunately, MSBuild provides quite a few options to dynamically include items. For example, you could have a custom target in your .wixproj that runs HEAT and adds the output

 <Target Name='RunHeat'>
     <Exec Command='heat.exe param param param -o path\to\output.wxs' />
     <ItemGroup>
         <Compile Include='path\to\output.wxs' />
     </ItemGroup>
 </Target>

Now if you get the RunHeat target to run before the Compile target in wix.targets then the Compile item generated in RunHeat will be included in the Compile target. Given the flexibility of MSBuild there are probably a dozen other ways you could accomplish this task.

Hope that helps and good luck!

like image 191
Rob Mensching Avatar answered Sep 28 '22 04:09

Rob Mensching