Harvesting a .csproj with heat.exe in Visual Studio 2008 and WiX(v3)
Asked Answered
O

4

7

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.

Oncoming answered 13/4, 2009 at 20:29 Comment(0)
B
2

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.

Betz answered 14/4, 2009 at 11:10 Comment(2)
I dug a bit, and Paraffin does now support v3. wintellect.com/CS/blogs/jrobbins/archive/2008/12/22/… This looks to be a potentially useful approach as it is capable of "remembering" some of the state of the autogeneration.Oncoming
I would have commented the new link before, but I wasn't sure how links in comments were supported...Looks like a URL is recognized. I guess it supports the same wiki syntax as an answer/question?Oncoming
P
1

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.

Perk answered 14/4, 2009 at 10:51 Comment(1)
Thanks, that did formalize the nagging doubts about autogeneration.Oncoming
P
0

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,

Dave

Psychologist answered 13/4, 2009 at 23:0 Comment(0)
S
0

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).

Swale answered 14/4, 2009 at 0:44 Comment(3)
The only place I could find mention of heat.exe was in Gábor DEÁK JAHN's tutorial, and it was very brief and not up to date with regard to parameters and implications. The -help option was really my only clue that more advanced approaches were available in v3.Oncoming
Look in the "DOC" directory of where you installed WiX. Along with the wix-users mailing list and you'll be on your way :)Swale
I started with the chm in the doc directory. The only mention was: "Heat"-"Generates WiX authoring from various input formats". Was there something else that you were referring to? My knowledge of the command line parameters came from the -help command (as mentioned in the background section)Oncoming

© 2022 - 2024 — McMap. All rights reserved.