This repository was archived by the owner on Feb 14, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 78
Document harvesting better #240
Open
BryanCrotaz
wants to merge
1
commit into
wixtoolset:master
Choose a base branch
from
BryanCrotaz:patch-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,11 +7,33 @@ sidebar_position: 100 | |
In WiX v4, Heat is available in a WiX extension NuGet Package. To use Heat to harvest directories, files, or projects: | ||
|
||
1. Add a reference to the [WixToolset.Heat NuGet package](https://www.nuget.org/packages/WixToolset.Heat/). | ||
2. Add an item group based on the kind of harvesting you want to do in your project: | ||
2. Add an item group in the project file (Right click on the wix project and select `Edit Project File`) based on the kind of harvesting you want to do in your project: | ||
- `HarvestDirectory` to harvest files from a directory | ||
- `HarvestFile` to harvest data from a file | ||
- `HarvestProject` to harvest output from a project | ||
|
||
```xml | ||
<Project Sdk="WixToolset.Sdk/4.0.2" TreatWarningsAsErrors="true"> | ||
<ItemGroup> | ||
<HarvestDirectory Include="$(SolutionDir)MyProject\bin\Release\net7.0"> | ||
<ComponentGroupName>MyHarvestedFiles</ComponentGroupName> | ||
<DirectoryRefId>INSTALLFOLDER</DirectoryRefId> | ||
<SuppressRootDirectory>true</SuppressRootDirectory> | ||
<!-- disabling harvesting registry keys makes HEAT5151 error go away during build --> | ||
<SuppressRegistry>true</SuppressRegistry> | ||
<SuppressFragments>true</SuppressFragments> | ||
<SuppressCom>true</SuppressCom> | ||
</HarvestDirectory> | ||
<BindPath Include="$(SolutionDir)MyProject\bin\Release\net7.0" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="WixToolset.Heat" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="$(SolutionDir)MyProject\MyProject.csproj" /> | ||
</ItemGroup> | ||
</Project> | ||
``` | ||
|
||
## Using `HarvestDirectory` to harvest files from a directory | ||
|
||
|
@@ -34,15 +56,15 @@ The following properties control harvesting: | |
| -------- | ----------- | | ||
| `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. When harvesting multiple directories in a project, specify this metadata to create unique file names for the generated authoring. The component group name that will contain all generated authoring. | | ||
| `HarvestDirectoryDirectoryRefId` | Optional string property. The identifier of the Directory element that will contain all generated authoring. | | ||
| `HarvestDirectoryDirectoryRefId` | Optional string property. The identifier of the Directory into which the harvested files will be copied when you run the installer. | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm writing this with newbies in mind. I really struggled with the documentation and I'm suggesting changes that make it more understandable. Verbose and explicit was what I was aiming for. |
||
| `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**. | | ||
| `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 a preprocessor variable name. For example, specify `MyDir` to have Heat use `$(MyDir)` instead of `SourceDir`. | | ||
| `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**. | | ||
| `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**. | | ||
| `HarvestDirectorySuppressRegistry` | Optional boolean property. Whether to suppress generation of all registry elements when harvesting files in directories. The default is **false**. If you get error *HEAT5151* when building, this feature needs to be turned off.| | ||
| `HarvestDirectorySuppressRootDirectory` | Optional boolean property. Whether to suppress generation of a Directory element for all authoring when harvesting. The default is **false**. | | ||
| `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**. | | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$(SolutionDir)
should not be used in examples. It is not always available.