Tutorial :Harvesting a .csproj with heat.exe in Visual Studio 2008 and WiX(v3)


I found that Wix v3 uses a tool (heat.exe) to "harvest" information into WiX fragments. Either I am looking in the wrong location, or this is thinly documented.

What is the best way to auto-generate a WiX fragment (likely using heat.exe) for a complex folder structure that contains media files:

  • Of varying types (ico/png/xaml/etc)
  • That may change regularly (names/locations/adds/removes)
  • That are classified as "Content" and included in a .csproj

such that they can be built into an installer via WiX and would withstand upgrades and patches with decorum?

Background Information

  1. I found heat.exe, which seems to solve the autogenerate WiX fragment requirement
  2. In getting the "dir" harvester working, I noticed the "project" harvester (commandline help)
  3. Media is already in C# project file, and so noted that "-pog:Content" might do very well
  4. Cursory search found out of date documentation that didn't mention "project" harvester
  5. Realized entire project installer could probably done with "project" harvester, but was unsure how well this was supported, and what the pitfalls were.
  6. Saw the generation of "PUT-GUID-HERE" and realized that autogeneration of guids would likely have upgrade/patch implications.
  7. Realized that there must be people who use these tools for similar purposes and could probably point me in the right direction.

It was (fairly) pointed out that v3 is not yet "done" (thus the scarceness of documentation and tutorials). The sense that I get now is that it is non-trivial to automate this in my build scripts, and the tools are growing right now to ease this.


In my experience John Robbins' Paraffin solves alot of the issues with tallow.exe (heat.exe in v3). I'm not sure if Paraffin plays nicely with v3, but it might be worth checking out.

FYI, I've used Paraffin in a build process and it allowed me to remove the previous 2-3 step cleanup process that involved a powershell script.


For the upgrade implications of auto-generated setups, read this. The take-home message:

Windows Installer doesn’t let you remove components in a minor upgrade

It is hard to guarantee that components continue to exist if you generate your setup automatically. Therefore you have to chose between auto-generation of components and the ability to do minor upgrades.

If you have some auto-generated components, then just stick to major upgrades. You can use this sample by Rob as an example.


Thanks for the background, I wasn't aware that they were working on a new version of Wix. According to the project page, it isn't RTM yet, so that may explain the problems you're having. I hope to hear from the WIX developers in one of the replies.

I can't help you use the under-development heat.exe features. However, I have been in your situation and my solution was to create a tool that took directory and file information as input and generated valid wix project files as output. A .vsproj file is just an XML file, and you can use XSL, C#'s LINQ, PowerShell, or a number of other tools to do the work. I personally have used (pre-LINQ) C#/XMLDOM to parse VS project files for this purpose.

Good Luck,



For documentation, check out the help file that is installed with WiX - WiX.chm provides the most up to date information (along with the command line -help option).

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »