Skip to main content
Version: v3

Harvest Tool (Heat)

Generates WiX authoring from various input formats.

Every time heat is run it regenerates the output file and any changes are lost.

Usage Information

heat.exe [-?] harvestType <harvester arguments> -out sourceFile.wxs

Heat supports the harvesting types:

Harvest Type

Meaning

dir 

Harvest a directory.

file

Harvest a file.

project

Harvest outputs of a Visual Studio project.

website

Harvest an IIS web site.

perf

Harvest performance counters from a category.

reg

Harvest registy information from a reg file..

Heat supports the following command line parameters:

Switch

Meaning

-ag

Auto generate component guids at compile time, e.g. set Guid="*".

-cg <ComponentGroupName>

Component group name (cannot contain spaces e.g -cg MyComponentGroup).

-configuration

Configuration to set when harvesting the project.

-directoryid

Overridden directory id for generated directory elements.

-dr <DirectoryName>

Directory reference to root directories (cannot contains spaces e.g. -dr MyAppDirRef).

-ext <extension>

Extension assembly or "class, assembly".

-generate

Specify what elements to generate, one of: components, container, payloadgroup, layout (default is components).

-gg

Generate guids now. All components are given a guid when heat is run.

-g1

Generate component guids without curly braces.

-ke

Keep empty directories.

-nologo

Skip printing heat logo information.

-out

Specify output file (default: write to current directory).

-platform

Platform to set when harvesting the project.

-pog:<group>

Specify output group of Visual Studio project, one of: Binaries, Symbols, Documents, Satellites, Sources, Content.

  • Binaries - primary output of the project, e.g. the assembly exe or dll.
  • Symbols - debug symbol files, e.g. pdb.
  • Documents - documentation files.
  • Satellites - the localized resource assemblies.
  • Sources - source files.
  • Content - content files.

This option may be repeated for multiple output groups; e.g. -pog:Binaries -pog:Content.

-projectname

Overridden project name to use in variables.

-scom

Suppress COM elements.

-sfrag

Suppress generation of fragments for directories and components.

-srd

Suppress harvesting the root directory as an element.

-sreg

Suppress registry harvesting.

-suid

Suppress unique identifiers for files, components, & directories.

-svb6

Suppress VB6 COM registration entries. When registering a COM component created in VB6 it adds registry entries that are part of the VB6 runtime component. This flag is recommend for VB6 components to avoid breaking the VB6 runtime on uninstall.

The following values are excluded:

  • CLSID\{D5DE8D20-ABB8-D1D1-A1E3-A0A0C90F2731}
  • Typelib\{EA544A21-C82D-CCD1-A3E4-A0A0C90AEA82}
  • Typelib\{F00204EF-A000-A000-C000-B00000000046}
  • Any Interfaces that reference these two type libraries

-sw<N>

Suppress all warnings or a specific message ID, e.g. -sw1011 -sw1012.

-swall

Suppress all warnings (deprecated).

-t <xsl>

Transform harvested output with XSL file.

-indent <n>

Indentation multiple (overrides default of 4).

-template <template>

Use template, one of: fragment, module, product.
Default: fragment.

-v

Verbose output.

-var <VariableName>

Substitute File/@Source="SourceDir" with a preprocessor or a wix variable (e.g. -var var.MySource will become File/@Source="$(var.MySource)\myfile.txt" and -var wix.MySource will become File/@Source="!(wix.MySource)\myfile.txt".

-wixvar

Generate binder variables instead of preprocessor variables.

-wx[N]

Treat all warnings or a specific message ID as an error. e.g. -wx1011 -wx1012.

-wxall

Treat all warnings as errors (deprecated).

-? | -help

 Display heat help information.

Command line examples

Harvest a directory

heat dir ".\My Files" -gg -sfrag -template:fragment -out directory.wxs

This will harvest the sub folder "My Files" as a single fragment to the file directory.wxs. It will generate guids for all the files as they are found.

Harvest a file

heat file ".\My Files\File.dll" -ag -template:fragment -out file.wxs

This will harvest the file "File.dll" as a single fragment to the file file.wxs. The component guid will be set to "*".

Harvest a Visual Studio project

heat project "MyProject.csproj" -pog:Binaries -ag -template:fragment -out project.wxs

This will harvest the binary output files from the Visual Studio project "MyProject.csproj" as a single fragment to the file project.wxs. The component guid will be set to "*".

Harvest a Website

heat website "Default Web Site" -template:fragment -out website.wxs

This will harvest the website "Default Web Site" as a single fragment to the file website.wxs.

Harvest a VB6 COM component

heat file ".\My Files\VB6File.dll" -ag -template:fragment -svb6 -out vb6file.wxs

This will harvest the VB6 COM component "VB6File.dll"as a single fragment to the file vb6file.wxs and suppress the VB6 runtime specific registy entries.

Harvest performance counters

heat perf "My Category" -out perf.wxs

This will harvest all the performance counters from the category "My Category".

Harvest a registry file

heat reg registry.reg -out reg.wxs

This will harvest all the registry information from the file registry.reg. The registry file can be either a standard "Windows Registry Editor Version 5.00" reigstry file or a legacy Win9.x/NT4 (REGEDIT4) reigstry file.