HarvestDirectory Target

WiX

HarvestDirectory Target

The HarvestDirectory target passes HarvestDirectory items to the HeatDirectory task to generate authoring from a file. Authoring is generated for type libraries and self-registration from DllRegisterServer for any files found in directories. This target is processed before compilation. Generated authoring is automatically added to the Compile item group to be compiled by the Candle task.

<ItemGroup>
  <HarvestDirectory Include="..\TestProject\Data">
    <DirectoryRefId>DataDir</DirectoryRefId>
  </HarvestDirectory>
</ItemGroup>

The following tables describe the common WiX MSBuild properties and items that are applicable to the HarvestDirectory target.

Items

The following items and item metadata are used by the HarvestDirectory target.

Item or Metadata Description
@(HarvestDirectory) Required item group.

The list of directories to harvest.
%(HarvestDirectory.ComponentGroupName) Optional string metadata. If you are harvesting multiple directories in your project, you should specify this metadata to create unique file names for the generated authoring.

The name of the ComponentGroup to create for all the generated authoring.
%(HarvestDirectory.DirectoryRefId) Optional string metadata.

The ID of the directory to reference instead of TARGETDIR.
%(HarvestDirectory.KeepEmptyDirectories) Optional boolean metadata.

Whether to create Directory entries for empty directories. The default is false.
%(HarvestDirectory.PreprocessorVariable) Optional string metadata.

Substitute SourceDir for another variable name (ex: var.Dir).
%(HarvestDirectory.SuppressCom) Optional boolean metadata.

Suppress generation of COM registry elements. The default is false.
%(HarvestDirectory.SuppressRootDirectory) Optional boolean metadata.

Suppress generation of a Directory element for the parent directory of the file. The default is false.
%(HarvestDirectory.SuppressRegistry) Optional boolean metadata.

Suppress generation of any registry elements. The default is false.
%(HarvestDirectory.Transforms) Optional string metadata.

XSL transforms to apply to the generated WiX authoring. Separate multiple transforms with semicolons.

Properties

The following properties are used by the HarvestDirectory target.

Property Description
$(HarvestDirectoryAutogenerateGuids) Optional boolean property.

Whether to generate authoring that relies on auto-generation of component GUIDs. The default is $(HarvestAutogenerateGuids) if specified; otherwise, true.
$(HarvestDirectoryComponentGroupName) Optional string property. If you are harvesting multiple directories in your project, you should specify this metadata to create unique file names for the generated authoring.

The component group name that will contain all generated authoring.

This global property is only usable with MSBuild 4.0 or Visual Studio 2010, and newer.
$(HarvestDirectoryDirectoryRefId) Optional string property.

The identifier of the Directory element that will contain all generated authoring.

This global property is only usable with MSBuild 4.0 or Visual Studio 2010, and newer.
$(HarvestDirectoryGenerateGuidsNow) Optional boolean property.

Whether to generate authoring that generates durable GUIDs when harvesting. The default is $(HarvestGenerateGuidsNow) if specified; otherwise, false.
$(HarvestDirectoryKeepEmptyDirectories) Optional boolean property.

Whether to create Directory entries for empty directories when harvesting. The default is false.

This global property is only usable with MSBuild 4.0 or Visual Studio 2010, and newer.
$(HarvestDirectoryNoLogo) Optional boolean property.

Whether to show the logo for heat.exe. The default is $(NoLogo) if specified; otherwise, false.
$(HarvestDirectoryPreprocessorVariable) Optional string property.

Substitute SourceDir for another variable name (ex: var.Dir) in all generated authoring.

This global property is only usable with MSBuild 4.0 or Visual Studio 2010, and newer.
$(HarvestDirectorySuppressAllWarnings) Optional boolean parameter.

Specifies that all warnings should be suppressed. The default is $(HarvestSuppressAllWarnings) if specified; otherwise, false.
$(HarvestDirectorySuppressCom) Optional boolean property.

Whether to suppress generation of COM registry elements when harvesting files in directories. The default is false.

This global property is only usable with MSBuild 4.0 or Visual Studio 2010, and newer.
$(HarvestDirectorySuppressFragments) Optional boolean property.

Whether to suppress generation of separate fragments when harvesting. The default is $(HarvestSuppressFragments) if specified; otherwise, true.
$(HarvestDirectorySuppressRegistry) Optional boolean property.

Whether to suppress generation of all registry elements when harvesting files in directories. The default is false.

This global property is only usable with MSBuild 4.0 or Visual Studio 2010, and newer.
$(HarvestDirectorySuppressRootDirectory) Optional boolean property.

Whether to suppress generation of a Directory element for all authoring when harvesting. The default is false.

This global property is only usable with MSBuild 4.0 or Visual Studio 2010, and newer.
$(HarvestDirectorySuppressSpecificWarnings) Optional string parameter.

Specifies that certain warnings should be suppressed. The default is $(HarvestSuppressSpecificWarnings) if specified.
$(HarvestDirectorySuppressUniqueIds) Optional boolean property.

Whether to suppress generation of unique component IDs. The default is $(HarvestSuppressUniqueIds) if specified; otherwise, false.
$(HarvestDirectoryTransforms) Optional string property.

XSL transforms to apply to all generated WiX authoring. Separate multiple transforms with semicolons. The default is $(HarvestTransforms) if specified.

This global property is only usable with MSBuild 4.0 or Visual Studio 2010, and newer.
$(HarvestDirectoryTreatSpecificWarningsAsErrors) Optional string parameter.

Specifies that certain warnings should be treated as errors. The default is $(HarvestTreatSpecificWarningsAsErrors) if specified.
$(HarvestDirectoryTreatWarningsAsErrors) Optional boolean parameter.

Specifies that all warnings should be treated as errors. The default is $(HarvestTreatWarningsAsErrors) if specified; otherwise, false.
$(HarvestDirectoryVerboseOutput) Optional boolean parameter.

Specifies that the tool should provide verbose output. The default is $(HarvestVerboseOutput) if specified; otherwise, false.