Practical guide
Create your first MSI installer with WiX
This guide starts with a single readme.txt file and ends with WixPieSample.msi. You can build the supplied source directly with WiX, then open the same source in WixPie to explore its installer properties visually.
1. Prepare Windows and the matching WiX toolset
Use a Windows development machine with WiX 3 or WiX 5 installed. Choose one version for this example. The WiX 3 command-line tools are candle.exe and light.exe; WiX 5 builds with wix build. Run the commands below from a terminal that can find the selected tools.
Create a new empty folder for the example. Download readme.txt and either Product.wxs for WiX 3 or Package.wxs for WiX 5 into that folder. Do not combine the two source files in the same build.
A complete, small MSI example
Choose the source for your installed WiX version. Download that source and readme.txt into the same empty folder. The two sources create equivalent 32-bit, per-machine packages and do not use any WiX extensions. They have been compiled with WiX 3.14 and WiX 5. The examples are independent of the visual editor, so you can also build them directly.
Download the sample payload: readme.txt
WiX 5 · Package.wxs
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package Name="WixPie Sample" Language="1033" Version="1.0.0"
Manufacturer="Example Company" UpgradeCode="8BE5A7F8-7C25-4DA8-B13F-42F53B670692"
Scope="perMachine">
<MajorUpgrade DowngradeErrorMessage="A newer version is already installed." />
<MediaTemplate EmbedCab="yes" />
<StandardDirectory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="WixPie Sample">
<Component Id="ReadmeComponent" Guid="*">
<File Id="ReadmeFile" Source="readme.txt" KeyPath="yes" />
</Component>
</Directory>
</StandardDirectory>
<Feature Id="MainFeature" Title="WixPie Sample" Level="1">
<ComponentRef Id="ReadmeComponent" />
</Feature>
</Package>
</Wix>
Build from the sample folder
wix build Package.wxs -arch x86 -o WixPieSample.msiWiX 3 · Product.wxs
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="WixPie Sample" Language="1033" Version="1.0.0"
Manufacturer="Example Company" UpgradeCode="8BE5A7F8-7C25-4DA8-B13F-42F53B670692">
<Package InstallerVersion="500" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version is already installed." />
<MediaTemplate EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="WixPie Sample">
<Component Id="ReadmeComponent" Guid="*">
<File Id="ReadmeFile" Source="readme.txt" KeyPath="yes" />
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id="MainFeature" Title="WixPie Sample" Level="1">
<ComponentRef Id="ReadmeComponent" />
</Feature>
</Product>
</Wix>
Build from the sample folder
candle.exe -arch x86 Product.wxs
light.exe -out WixPieSample.msi Product.wixobjThe UpgradeCode identifies this sample's upgrade family. Generate your own UpgradeCode when creating a different real product, then keep it stable for later versions of that product. Keep authored component and file IDs stable when maintaining a released installer.
2. Understand what the package installs
Both versions define a product named WixPie Sample, version 1.0.0, and place readme.txt in a WixPie Sample directory under Program Files for the package architecture. The build commands select x86, so a 64-bit Windows test machine normally uses Program Files (x86). The package is per-machine; installation may request administrator approval.
ReadmeComponent owns the file and MainFeature references that component. KeyPath marks the file Windows Installer uses to identify the component's installed state. MediaTemplate embeds the payload cabinet in the MSI so this small sample can be distributed as one package.
3. Open the same source in WixPie
Open WixPie Online and use File → Open files… to select the sample .wxs file. Choose an editor template compatible with the source version. Inspect the product or package name, version, directory, component and file in the available pages and XML preview.
For a browser-only session, use Download current file to keep an edited copy. For a local project workflow, set up the Local Agent and extension, create a .wixpie project from the document when that command is available, and select the matching installed toolset. Keep readme.txt beside the source so its relative Source path resolves.
4. Build, install and remove the sample
Run the build commands for your WiX version in the sample folder. A successful build produces WixPieSample.msi. Building the package does not install it. You can also build a configured local .wixpie project through the connected agent.
Test the MSI in Windows Sandbox or a disposable Windows virtual machine. Run msiexec /i WixPieSample.msi /l*v install.log, check that readme.txt appears in the installation directory, then remove the package with Windows Installed apps or msiexec /x WixPieSample.msi. Confirm that the sample file is removed.
If the build fails
Read the first compiler error before changing the source. For this example, the most common causes are a missing payload, the wrong working directory or a mismatch between the source format and the installed toolset.
- File not found: keep readme.txt in the current sample folder with the .wxs file.
- Command not found: use a terminal configured for the installed WiX toolset, or use the tool's full executable path.
- Unexpected Product or Package element: use the sample that matches WiX 3 or WiX 5.
- Local build unavailable in WixPie: verify the extension, agent connection, project settings and selected toolset.
Try the workflow in WixPie
Open the browser editor to explore a compatible template. For local files and MSI builds, follow the Local Agent and extension setup on the Downloads page.