Compare commits

...

2 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
a0c197da67 Fix install location missing in uninstall registry entry
Co-authored-by: yeelam-gordon <73506701+yeelam-gordon@users.noreply.github.com>
2025-09-05 09:26:55 +00:00
copilot-swe-agent[bot]
122148ca58 Initial plan 2025-09-05 09:15:56 +00:00
3 changed files with 26 additions and 5 deletions

View File

@@ -80,6 +80,7 @@
<ComponentGroupRef Id="MonacoSRCHeatGenerated" />
<ComponentGroupRef Id="WorkspacesComponentGroup" />
<ComponentGroupRef Id="CmdPalComponentGroup" />
<ComponentRef Id="UninstallRegistryComponent" />
</Feature>
<SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLFOLDER]" After="CostFinalize" />
@@ -513,6 +514,15 @@
<Binary Id="PTCustomActions" SourceFile="$(var.PowerToysSetupCustomActions.TargetPath)" />
</Fragment>
<!-- Ensure InstallLocation is set in uninstall registry -->
<Fragment>
<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>
</Fragment>
<!-- Installation directory structure -->
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">

View File

@@ -67,6 +67,7 @@
<ComponentGroupRef Id="MonacoSRCHeatGenerated" />
<ComponentGroupRef Id="WorkspacesComponentGroup" />
<ComponentGroupRef Id="CmdPalComponentGroup" />
<ComponentRef Id="UninstallRegistryComponent" />
</Feature>
<SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLFOLDER]" After="CostFinalize" />
@@ -254,6 +255,15 @@
<Binary Id="PTCustomActions" SourceFile="$(var.PowerToysSetupCustomActionsVNext.TargetPath)" />
</Fragment>
<!-- Ensure InstallLocation is set in uninstall registry -->
<Fragment>
<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>
</Fragment>
<!-- Installation directory structure -->
<Fragment>
<StandardDirectory Id="$(var.DefaultInstallDir)">

View File

@@ -202,12 +202,13 @@ function Test-PowerToysInstallation {
if ($powerToysEntry) {
Add-CheckResult -Category "Registry" -CheckName "Uninstall Registry Entry ($Scope)" -Status 'Pass' -Message "PowerToys uninstall entry found with DisplayName: $($powerToysEntry.DisplayName)"
# Note: InstallLocation may or may not be set in the uninstall registry
# This is normal behavior as PowerToys uses direct file references for system bindings
# InstallLocation should be set in the uninstall registry as of installer version fixing issue #41638
if ($powerToysEntry.InstallLocation) {
Add-CheckResult -Category "Registry" -CheckName "Install Location Registry ($Scope)" -Status 'Pass' -Message "InstallLocation found: $($powerToysEntry.InstallLocation)"
}
# No need to report missing InstallLocation as it's not required
else {
Add-CheckResult -Category "Registry" -CheckName "Install Location Registry ($Scope)" -Status 'Fail' -Message "InstallLocation is missing from uninstall registry entry. This may indicate an installer issue."
}
}
else {
Add-CheckResult -Category "Registry" -CheckName "Uninstall Registry Entry ($Scope)" -Status 'Fail' -Message "PowerToys uninstall entry not found in Windows uninstall registry"
@@ -246,8 +247,8 @@ function Get-PowerToysInstallPath {
return $InstallPath
}
# Since InstallLocation may not be reliably set in the uninstall registry,
# we'll use the default installation paths based on scope
# Try to get path from registry first, fall back to default paths if needed
# InstallLocation should be reliably set as of installer version fixing issue #41638
if ($Scope -eq 'PerMachine') {
$defaultPath = "${env:ProgramFiles}\PowerToys"
}