Skip to content

Commit 117512d

Browse files
andyclaude
andcommitted
MSI: install empty directories (the shell needs tmp); report where the uninstall entry lands
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PFPK14wBcLD1s4dYUowpP4
1 parent fa5d334 commit 117512d

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎packaging/windows/make-msi.ps1‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ $ids = @{}; $nid = 0
1919
$sb = New-Object System.Text.StringBuilder
2020
function Esc($s) { [Security.SecurityElement]::Escape($s) }
2121
function Emit($dir, $indent) {
22+
# Empty directories (the shell's tmp) are not installed unless something creates them.
23+
if (-not (Get-ChildItem -LiteralPath $dir -Force)) {
24+
$script:nid++
25+
[void]$sb.AppendLine("$indent<Component Id=`"c$nid`"><CreateFolder /></Component>")
26+
}
2227
foreach ($f in Get-ChildItem -LiteralPath $dir -File) {
2328
$script:nid++
2429
[void]$sb.AppendLine("$indent<Component Id=`"c$nid`"><File Id=`"f$nid`" Source=`"$(Esc $f.FullName)`" KeyPath=`"yes`" /></Component>")

‎tests/windows/msi-test.ps1‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ $p = Start-Process msiexec -ArgumentList "/i `"$Msi`" /qn /l*v `"$Out\install.lo
2222
Check ($p.ExitCode -eq 0) "msiexec /i exit $($p.ExitCode)"
2323
Check (Test-Path "$inst\bin\organizer.exe") "organizer.exe under $inst"
2424
Check (Test-Path $lnk) "Start-menu shortcut"
25+
foreach ($h in "HKCU", "HKLM") { foreach ($k in "Software\Microsoft\Windows\CurrentVersion\Uninstall", "Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall") {
26+
Get-ItemProperty "${h}:\$k\*" -ErrorAction SilentlyContinue | Where-Object { $_.DisplayName -like "ECCE*" } | ForEach-Object { Say "uninstall entry: ${h}:\$k\$($_.PSChildName) $($_.DisplayName)" } } }
2527
$arp = Get-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" -ErrorAction SilentlyContinue | Where-Object { $_.DisplayName -eq "ECCE" }
2628
Check ($null -ne $arp) "Apps & Features entry in HKCU (per user)"
2729
Check (-not (Get-ItemProperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" -ErrorAction SilentlyContinue | Where-Object { $_.DisplayName -eq "ECCE" })) "no HKLM entry"
@@ -48,7 +50,7 @@ foreach ($c in "complete", "cancel") {
4850
$env:Path = $sys
4951
tests\windows\ci-run.ps1 -Stage $stage -Out "$Out\apps"
5052
Get-Content "$Out\apps\summary.txt" | ForEach-Object { Say "apps: $_" }
51-
Check (-not (Select-String -Path "$Out\apps\summary.txt" -Pattern "exited rc|missing|FAILED" -Quiet)) "start test summary has no app exited, missing or failed"
53+
Check (-not (Select-String -Path "$Out\apps\summary.txt" -Pattern "exited rc=-?[1-9]|missing|FAILED" -Quiet)) "start test summary has no app exited, missing or failed"
5254

5355
# The shortcut's own path: wscript + ecce.vbs + ecce.cmd, no console window.
5456
Start-Process "$env:SystemRoot\System32\wscript.exe" -ArgumentList "//B //Nologo `"$inst\ecce.vbs`""

0 commit comments

Comments
 (0)