WiX Toolset: Change MSI Uninstall Product GUID Key?
In WiX Toolset v5/v6, can you change MSI uninstall registry key from Product GUID to custom name like 'MyApp'? No, per MSI standards, but customize DisplayName and use registry query workarounds for wix msi uninstall handling.
In WiX (v5 or v6), is it possible to change the MSI application’s uninstall registry key from the default Product GUID to a custom name like ‘MyApp 3.1.4.23’ in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall?
No, in WiX Toolset v5 or v6, you can’t change the MSI uninstall registry key from the default Product GUID to a custom name like ‘MyApp 3.1.4.23’ under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall. That’s baked into the MSI standard—the key must be the ProductCode GUID for Windows Installer to manage installs, upgrades, and removals properly. But you can tweak the DisplayName value inside that key to show something friendly in Programs & Features, and there are solid workarounds like scripting registry queries for custom handling.
Contents
- Understanding MSI Uninstall Registry Keys in WiX Toolset
- The Role of Product GUID in WiX MSI Packages
- Why You Cannot Change the Uninstall Key in WiX v5/v6
- Customizing DisplayName and Other Visible Values
- Workarounds for Custom Uninstall Handling
- WiX Toolset v5 and v6 Specifics
- Best Practices for WiX MSI Management
- Sources
- Conclusion
Understanding MSI Uninstall Registry Keys in WiX Toolset
Ever peeked under the hood of Add/Remove Programs? Those entries come from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, where each installed app gets its own subkey. For MSI-based installs—like those built with WiX Toolset—that subkey is always named after the ProductCode, a unique GUID like {12345678-1234-1234-1234-123456789ABC}.
Why rigid like that? Windows Installer relies on it to track everything: repairs, mods, upgrades. Change the key name to ‘MyApp 3.1.4.23’, and poof—Control Panel can’t find it, msiexec chokes on uninstalls, and major breakage ensues. Inside the key, though, you’ve got flexible values: DisplayName (what users see), Publisher, InstallDate, and UninstallString.
Picture this: Install a WiX MSI, and regedit shows {GUID}\DisplayName = "MyApp 3.1.4.23". The GUID stays fixed, but the name shines through. Makes sense for stability, right? WiX Toolset honors this MSI uninstall structure across versions, from the old wix toolset 3.11 days to modern wix 5 and wix 6.
The Role of Product GUID in WiX MSI Packages
At the heart of any WiX MSI is the Product element. Here’s a snippet from a typical .wxs file:
<Product Id="*" Name="MyApp 3.1.4.23" Language="1033" Version="3.1.4.23" Manufacturer="YourCo" UpgradeCode="YOUR-UPGRADE-GUID">
That Id="*" auto-generates a Product GUID during build—your uninstall key. Set it explicitly if needed, but it’s always a GUID. No strings allowed; MSI demands it for identity.
The ProductCode property in MSI specs locks this down: “The ProductCode is the GUID that Windows Installer uses to identify the application.” WiX msi packages stick to this, whether you’re on wix 3, wix 4, or grabbing the latest wix toolset download for v6.
Upgrades? They match via UpgradeCode, but the per-product GUID key never budges. It’s why tools like Orca (MSI editor) show it as immutable.
Why You Cannot Change the Uninstall Key in WiX v5/v6
Straight up: MSI forbids it. The Uninstall Registry Key docs spell out that subkeys “use the product code GUID as the key name.” WiX Toolset, being an MSI generator, can’t override core Windows Installer rules without hacking the format—and that’d make your installer non-standard, breaking compatibility.
Tried custom actions to rename keys? Risky. Windows protects that hive; plus, during install, the key’s created with the GUID before custom actions run fully. Post-install tweaks via script? Users could delete your app’s entry accidentally, or Windows Updates wipe it.
In wix 5 and wix 6, no new schema element like <UninstallKeyName>MyApp</UninstallKeyName> exists. It’s not coming—MSI’s been this way since Windows 2000. If you’re migrating from wix toolset v 3.11 or wix 3, same story.
Customizing DisplayName and Other Visible Values
Can’t rename the key? Fine—make the contents pop. Set Name="MyApp 3.1.4.23" in Product, and it flows to DisplayName. Add Manufacturer="Your Company" for Publisher. Want icons or descriptions? Bundle those properties.
For dynamic versions, use WiX variables:
<?define AppVersion="!(bind.fileVersion.MyApp.exe)" ?>
<Product ... Name="MyApp $(var.AppVersion)" Version="$(var.AppVersion)" />
Users see “MyApp 3.1.4.23” in Programs & Features, sorted nicely. Per this Stack Overflow thread, that’s the go-to for friendly listing without touching the GUID key.
Other tweaks: Quiet uninstall flags via ARPSYSTEMCOMPONENT=1 (hides it), or localized strings for global reach.
Workarounds for Custom Uninstall Handling
Need to uninstall by name, not GUID? Script it. PowerShell shines here—query the Uninstall hive by DisplayName:
Get-ChildItem "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" |
Where-Object { $_.GetValue('DisplayName') -like "*MyApp*" } |
ForEach-Object { $uninstallString = $_.GetValue('UninstallString'); if ($uninstallString) { Start-Process msiexec.exe -Args "/x $($_.PSChildName) /quiet" } }
This grabs GUIDs matching “MyApp 3.1.4.23”, then runs msiexec /x {GUID} /quiet. Perfect for uninstall msi center sdk scenarios or custom launchers.
In WiX itself, use <RegistrySearch> in custom actions to find by name/Publisher, then launch UninstallString. Check this example for bundle upgrades.
CMD fallback: wmic product where "name like '%MyApp%'" call uninstall /nointeractive. Handles wix msi without hardcoding GUIDs.
WiX Toolset v5 and v6 Specifics
WiX evolved: v4+ shifted to <Package> from <Product> for bundles, but traditional MSIs still use Product GUID keys. In WiX schema, Id gets a GUID prefix for detection, yet Uninstall subkeys remain ProductCode-based.
v5 brings better .NET support and faster builds; v6 refines XML and extensibility—no key name changes. Backward compat with wix toolset 3.11? Full, via heat.exe harvesting. Download from wixtoolset.org—wix 5 (49 searches lately) edges out wix 6 in popularity.
Burn bundles? They use Bundle Id GUIDs similarly, but MSI components keep their Product GUIDs.
Best Practices for WiX MSI Management
Keep GUIDs stable across minor updates (change for majors). Use Id="*" for auto-gen, but lock UpgradeCode. Test uninstalls rigorously—msiexec /x {GUID} /l*v log.txt.
For multi-product suites, script queries over hard GUIDs. Avoid registry mods in WiX; use <RemoveRegistryKey> sparingly for cleanup.
Tools: WiX Toolset Visual Studio extension for drag-drop, or CLI for CI/CD. If ditching MSI, consider MSIX—but that’s another rabbit hole.
Sources
- ProductCode Property — MSI specification defining ProductCode GUID as required uninstall registry key name: https://learn.microsoft.com/en-us/windows/win32/msi/productcode
- Uninstall Registry Key — Windows Installer documentation on Uninstall hive structure and GUID subkeys: https://learn.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key
- Product Element — WiX v3 schema reference for Product Id GUID and Name mapping to DisplayName: https://wixtoolset.org/docs/v3/xsd/wix/product/
- Package Element — WiX schema for v4+ Package Id handling in bundles and MSIs: https://wixtoolset.org/docs/schema/wxs/package/
- How to change Add/Remove Program name using WiX installer — Stack Overflow guide to customizing DisplayName in Programs & Features: https://stackoverflow.com/questions/26156405/how-to-change-add-remove-program-name-using-wix-installer
- How do you uninstall another program in WiX installer — Example of RegistrySearch for name-based uninstalls: https://stackoverflow.com/questions/31732240/how-do-you-uninstall-another-program-in-wix-installer
- Dealing with changed UpgradeCode in WiX — Discussion on querying Uninstall keys by DisplayName: https://stackoverflow.com/questions/13694566/dealing-with-changed-upgrade-code-in-wix-where-old-installer-allowed-both-per-u
Conclusion
WiX Toolset keeps MSI uninstall keys locked to Product GUIDs for rock-solid compatibility—no custom names like ‘MyApp 3.1.4.23’ allowed, but customizing DisplayName gets you 90% there visually. Lean on scripts for programmatic msi uninstall by name, and you’re golden across wix 5, wix 6, or legacy versions. Grab the latest wix toolset download, tweak your .wxs, and build confidently—stability wins over whims.