Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 588
el2iot2 Avatar asked Apr 13 '09 20:04

el2iot2


2 Answers

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.

like image 183
Richard Szalay Avatar answered Oct 16 '22 05:10

Richard Szalay


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.

like image 23
Wim Coenen Avatar answered Oct 16 '22 06:10

Wim Coenen