WiX v2 had the tallow tool which was able to harvest a WiX fragment from a file exported from the registry (reg file). WiX v3’s replacement for this tool, Heat, lost this functionality. The code presented here adds this back as an extension to Heat. It also gives an example of how to write a custom heat extension.
Using the extension
To create a basic fragment run:
heat regfile filename.reg –ext Wix.RegFileHeatExtension.dll –out regfile.wxs
To create a more useful fragment run:
heat regfile filename.reg –ext Wix.RegFileHeatExtension.dll –out regfile.wxs -gg -g1 -indent 2 -cg compGroup
This creates a fragment that can be referenced via the “compGroup” ComponentGroupRef/@Id element. It will also have automatically generated guids, for more information on the command line see the Heat documentation.
It should be noted that due to limitations in Windows Installer the following registry keys are not harvested by this extension:
- REG_NONE(0), REG_LINK(6), REG_RESOURCE_LIST(8), REG_FULL_RESOURCE_DESCRIPTOR(9), REG_RESOURCE_REQUIREMENTS_LIST(a), REG_QWORD(b).
- These will all start hex(n) in the reg file where “n” is the number/letter in brackets above.
I am hoping to get this functionality added to the WiX v3.5 core Heat command.
I hope you find this useful, if you find any problems with harvesting registry files please let me know.
Edit 04/08/10: Update to support WiX 3.0 properly.Edit 16/12/10: This feature is now built in to WiX 3.5, see help file for details.