Skip to content

Fix install location missing in uninstall registry entry#41639

Closed
Copilot wants to merge 1 commit into
mainfrom
copilot/fix-41638
Closed

Fix install location missing in uninstall registry entry#41639
Copilot wants to merge 1 commit into
mainfrom
copilot/fix-41638

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 5, 2025

The PowerToys installer was not setting the InstallLocation value in the Windows uninstall registry entry, preventing Windows Add/Remove Programs and other system tools from properly locating the PowerToys installation directory.

Root Cause

While the installer was setting the ARPINSTALLLOCATION MSI property, this WiX approach doesn't always reliably write the InstallLocation registry value in all scenarios. The verification script even treated missing InstallLocation as "normal behavior," but this prevented proper integration with Windows system tools.

Solution

Added an explicit registry component (UninstallRegistryComponent) to both WiX 3 and WiX 5 installers that directly writes the InstallLocation value to the uninstall registry key:

<Component Id="UninstallRegistryComponent" Guid="*" Directory="INSTALLFOLDER">
  <RegistryKey Root="$(var.RegistryScope)" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductCode]">
    <RegistryValue Name="InstallLocation" Type="string" Value="[INSTALLFOLDER]" />
  </RegistryKey>
</Component>

This ensures the InstallLocation value is always written to the correct registry hive (HKLM for per-machine installations, HKCU for per-user installations) regardless of ARPINSTALLLOCATION behavior.

Changes Made

  • installer/PowerToysSetup/Product.wxs: Added UninstallRegistryComponent and referenced it in CoreFeature
  • installer/PowerToysSetupVNext/Product.wxs: Added UninstallRegistryComponent and referenced it in CoreFeature
  • tools/Verification scripts/verify-installation-script.ps1: Updated to expect InstallLocation and report missing values as failures

Benefits

  • InstallLocation is now reliably set for both per-machine and per-user installations
  • Windows Add/Remove Programs can properly locate the installation
  • System tools and scripts can find the installation directory through standard registry lookup
  • Verification script now properly validates the installation completeness

Fixes #41638.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Install location missing in Uninstall registry entry Fix install location missing in uninstall registry entry Sep 5, 2025
Copilot AI requested a review from yeelam-gordon September 5, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Install location missing in Uninstall registry entry

2 participants