Converting WiX Toolkit v3 XML Code to WiX Toolkit v4
WiX Toolkit has undergone significant changes between v3 and v4, with improvements in the delivery model, MSBuild project support, and command-line tools.

WiX Toolkit has undergone significant changes between v3 and v4, with improvements in the delivery model, MSBuild project support, and command-line tools. To transition from WiX v3 to WiX v4, you’ll need to convert your existing WiX v3 authoring to the new WiX v4 language. This short guide will walk you through the process of converting your WiX v3 XML code to WiX v4 using the wix convert
command. firegiant.com
Prerequisites
Before you begin, ensure you have the following installed:
- WiX v4 .NET tool: Install the WiX v4 .NET tool by following the instructions in the WiX v4 documentation.
- Version control: Make sure your WiX v3 source code is in a version control system, so you can easily revert any changes made by
wix convert
if necessary.
Converting WiX v3 to WiX v4
Once you have the WiX v4 .NET tool installed, you can use the wix convert
command to convert your WiX v3 authoring to WiX v4. firegiant.com
Converting Individual WiX Source Files
To convert a single WiX v3 source file to WiX v4, run the following command:
wix convert path\to\file.wxs
Replace path\to\file.wxs
with the path to your WiX v3 source file. firegiant.com
Converting All WiX Source Files in a Directory
To convert all WiX v3 source files in a specified directory, run the following command:
wix convert --recurse path\to\directory
Replace path\to\directory
with the path to the directory containing your WiX v3 source files. firegiant.com
Performing a Dry Run
By default, wix convert
overwrites the original files with the converted versions. If you want to see the changes wix convert
would make without actually modifying the files, use the --dry-run
switch:
wix convert --dry-run path\to\file.wxs
Replace path\to\file.wxs
with the path to your WiX v3 source file. firegiant.com
Conclusion
Converting your WiX v3 XML code to WiX v4 using wix convert
is a straightforward process. With the WiX v4 .NET tool installed and your source code in version control, you can easily convert individual files or entire directories. Remember to use the --dry-run
switch if you want to preview the changes before overwriting your original files. Happy converting!