Sanet.Tools.Wix.ComponentsUpdater 1.0.1

dotnet tool install --global Sanet.Tools.Wix.ComponentsUpdater --version 1.0.1
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local Sanet.Tools.Wix.ComponentsUpdater --version 1.0.1
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Sanet.Tools.Wix.ComponentsUpdater&version=1.0.1
nuke :add-package Sanet.Tools.Wix.ComponentsUpdater --version 1.0.1

Wix Components Updater

Wix Components Updater is a .NET tool that simplifies the process of generating WiX component entries for your project's output files. It is designed to be used in conjunction with the WiX toolset for creating Windows Installer packages.

Overview

When building a WiX project, it can be challenging to manually add all the output files, especially when there are many dependencies or when new files are added to the project. Wix Components Updater automates this process by scanning a specified folder and generating WiX component entries for any DLL or EXE files that are not already present in the WiX source file. Wix's heat harvester tool can help with it as well, but it's a complex tool that require a lot of configurations. For ci/cd scenarios I needed something very simple.

Installation

Wix Components Updater can be installed as a .NET tool via NuGet. Make sure you have the .NET CLI installed.

To install Wix Components Updater (sanet-wix-tools), use the following command:

dotnet tool install --global Sanet.Tools.Wix.ComponentsUpdater --version 1.0.0

Usage

To use Wix Components Updater, follow these steps:

  1. [Optional] Create a WiX source file (<componentName>.wxs) for a component and add the necessary component entries for the main files in your project. You can specify additional parameters as needed:
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
  <Fragment>
    <ComponentGroup Id="<componentName>" Directory="INSTALLFOLDER">
      <Component>
        <File Source="${pathToOutput}/<YouApp>.exe" />
      </Component>
    </ComponentGroup>
  </Fragment>
</Wix>
  1. If the file doesn't exist, the tool will create it.

  2. Build your project to generate the output files. For example:

dotnet build

or

dotnet publish -c Release
  1. Run Wix Components Updater, providing the componentName (which should match your WiX source file name without the extension) and the pathToOutput where the output files are located. For example:
dotnet sanet-wix-tools MyComponentName ../../Myapp/bin/Debug/net7.0/publish

Wix Components Updater will scan the specified folder for DLL and EXE files. For each file that doesn't already have a corresponding component entry in the WiX source file, it will generate a new component entry and add it to the ComponentGroup in the XML.

  1. Build your WiX project as usual:
wix build <your wix source files > -o <your wix bundle>

Example

An example of how Wix Components Updater can be used in a real workflow could be found in the MagicalYatzyXF repo, where it used in the publish-windows.yml GitHub Action.

License

Wix Components Updater is released under the MIT License. See the LICENSE.md file for more details.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
1.0.1 121 6/18/2023
1.0.0 107 6/18/2023