Skip to content

Commit 4080c38

Browse files
andyclaude
andcommitted
msi-test: accept the uninstall entry in either hive (elevated runner)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PFPK14wBcLD1s4dYUowpP4
1 parent f8aa644 commit 4080c38

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎tests/windows/msi-test.ps1‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ Check (Test-Path "$inst\bin\organizer.exe") "organizer.exe under $inst"
2424
Check (Test-Path $lnk) "Start-menu shortcut"
2525
foreach ($h in "HKCU", "HKLM") { foreach ($k in "Software\Microsoft\Windows\CurrentVersion\Uninstall", "Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall") {
2626
Get-ItemProperty "${h}:\$k\*" -ErrorAction SilentlyContinue | Where-Object { $_.DisplayName -like "ECCE*" } | ForEach-Object { Say "uninstall entry: ${h}:\$k\$($_.PSChildName) $($_.DisplayName)" } } }
27-
$arp = Get-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" -ErrorAction SilentlyContinue | Where-Object { $_.DisplayName -eq "ECCE" }
28-
Check ($null -ne $arp) "Apps & Features entry in HKCU (per user)"
29-
Check (-not (Get-ItemProperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" -ErrorAction SilentlyContinue | Where-Object { $_.DisplayName -eq "ECCE" })) "no HKLM entry"
27+
# Elevated (as on the runner) Windows Installer files a per-user package's entry under HKLM; unelevated it is HKCU.
28+
$arp = (Get-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*", "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" -ErrorAction SilentlyContinue | Where-Object { $_.DisplayName -eq "ECCE" })
29+
Check ($null -ne $arp) "Apps & Features entry present"
3030
Say ("installed: {0:N0} MB, {1} files" -f ((Get-ChildItem $inst -Recurse -File | Measure-Object Length -Sum).Sum / 1MB), (Get-ChildItem $inst -Recurse -File).Count)
3131
$t = New-Object -ComObject WScript.Shell
3232
Say ("shortcut: " + $t.CreateShortcut($lnk).TargetPath + " " + $t.CreateShortcut($lnk).Arguments)

0 commit comments

Comments
 (0)