mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-24 10:08:00 -06:00
* #143: Windows MSI desktop shortcut checkbox and install-complete dialog Add native installer dialogs (installer-ui.wxs): a welcome screen with a "Create a desktop shortcut" checkbox (ticked by default), repair/remove, progress, and "Setup completed successfully" / failed / cancelled screens with Finish. Unattended /qn and /qb installs never wait on a dialog and can skip the desktop shortcut with INSTALLDESKTOPSHORTCUT=0. Start Menu and desktop shortcuts are now plain links to pdfcraft.exe in their own components (HKLM key paths, removed on uninstall) instead of advertised MSI shortcuts. test-msi.ps1 checks the compiled MSI's shortcut, checkbox and dialog tables during packaging; the ARM64 install smoke test checks both shortcut targets, their removal on uninstall, and the INSTALLDESKTOPSHORTCUT=0 opt-out. Co-authored-by: ChatGPT <noreply@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JqiBTPWGWbhQDYNFcxFte6 * #143: run test-msi out of process before signing; add files-in-use dialog test-msi.ps1 held the MSI open through a Windows Installer COM handle in package.ps1's own process, so signtool could fail on signed release builds. Run it in a child process and release the COM objects. The hand-authored UI had no MsiRMFilesInUse dialog, so an upgrade or repair while PdfCraft is running could not offer to close it. Add one (OK closes the programs with MSIRMSHUTDOWN=2, Cancel stops setup) and check for it in test-msi.ps1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JqiBTPWGWbhQDYNFcxFte6 --------- Co-authored-by: ChatGPT <noreply@openai.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Brandon Thomas <echelon@gmail.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
ChatGPT
Brandon Thomas
parent
d7b93b56b5
commit
9e0fcc1380
@@ -46,7 +46,7 @@ jobs:
|
||||
}
|
||||
- name: XML, desktop entry, AppStream, Flatpak manifest
|
||||
run: |
|
||||
xmllint --noout packaging/windows/pdfcraft.wxs packaging/macos/*.plist* packaging/linux/*.xml*
|
||||
xmllint --noout packaging/windows/*.wxs packaging/macos/*.plist* packaging/linux/*.xml*
|
||||
# Windows Installer needs Icon ids ending in .ico or .exe, or shortcuts show a blank icon (#57).
|
||||
if grep -oE '<Icon Id="[^"]*"' packaging/windows/pdfcraft.wxs | grep -vE '\.(ico|exe)"$'; then
|
||||
echo "::error file=packaging/windows/pdfcraft.wxs::Icon Id must end in .ico or .exe"; exit 1
|
||||
|
||||
@@ -68,13 +68,26 @@ jobs:
|
||||
with:
|
||||
name: pdfcraft-windows-arm64
|
||||
path: dist
|
||||
- name: Install the MSI, check it, run it, uninstall it
|
||||
- name: Install the MSI, check it, run it, uninstall it, reinstall without the desktop shortcut
|
||||
shell: pwsh
|
||||
run: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$msi = (Get-ChildItem dist/*.msi | Select-Object -First 1).FullName
|
||||
$p = Start-Process msiexec.exe -ArgumentList '/i', "`"$msi`"", '/qn', '/l*v', 'install.log' -Wait -PassThru
|
||||
if ($p.ExitCode -ne 0) { Get-Content install.log -Tail 60; throw "msiexec /i exited $($p.ExitCode)" }
|
||||
$shortcuts = @(
|
||||
(Join-Path ([Environment]::GetFolderPath('CommonPrograms')) 'PdfCraft.lnk'),
|
||||
(Join-Path ([Environment]::GetFolderPath('CommonDesktopDirectory')) 'PdfCraft.lnk')
|
||||
)
|
||||
# Plain shortcuts to the program (#143), not advertised ones, so TargetPath is the exe.
|
||||
$exePath = Join-Path $env:ProgramFiles 'PdfCraft\pdfcraft.exe'
|
||||
$wsh = New-Object -ComObject WScript.Shell
|
||||
foreach ($shortcut in $shortcuts) {
|
||||
if (-not (Test-Path -LiteralPath $shortcut)) { throw "installer did not create $shortcut" }
|
||||
$target = $wsh.CreateShortcut($shortcut).TargetPath
|
||||
if ($target -ne $exePath) { throw "$shortcut points to '$target', not $exePath" }
|
||||
Write-Output "ok $shortcut -> $target"
|
||||
}
|
||||
$dir = Join-Path $env:ProgramFiles 'PdfCraft'
|
||||
foreach ($exe in 'pdfcraft.exe', 'pdfcraft-cli.exe') {
|
||||
$path = Join-Path $dir $exe
|
||||
@@ -110,7 +123,19 @@ jobs:
|
||||
$p = Start-Process msiexec.exe -ArgumentList '/x', "`"$msi`"", '/qn' -Wait -PassThru
|
||||
if ($p.ExitCode -ne 0) { throw "msiexec /x exited $($p.ExitCode)" }
|
||||
if (Test-Path (Join-Path $dir 'pdfcraft.exe')) { throw 'uninstall left pdfcraft.exe behind' }
|
||||
foreach ($shortcut in $shortcuts) {
|
||||
if (Test-Path -LiteralPath $shortcut) { throw "uninstall left $shortcut behind" }
|
||||
}
|
||||
Write-Output 'ok uninstalled'
|
||||
# Unattended installs can opt out of the desktop shortcut (#143); the Start Menu one stays.
|
||||
$p = Start-Process msiexec.exe -ArgumentList '/i', "`"$msi`"", '/qn', 'INSTALLDESKTOPSHORTCUT=0', '/l*v', 'install-nodesktop.log' -Wait -PassThru
|
||||
if ($p.ExitCode -ne 0) { Get-Content install-nodesktop.log -Tail 60; throw "msiexec /i INSTALLDESKTOPSHORTCUT=0 exited $($p.ExitCode)" }
|
||||
if (-not (Test-Path -LiteralPath $shortcuts[0])) { throw "INSTALLDESKTOPSHORTCUT=0 also skipped $($shortcuts[0])" }
|
||||
if (Test-Path -LiteralPath $shortcuts[1]) { throw "INSTALLDESKTOPSHORTCUT=0 still created $($shortcuts[1])" }
|
||||
$p = Start-Process msiexec.exe -ArgumentList '/x', "`"$msi`"", '/qn' -Wait -PassThru
|
||||
if ($p.ExitCode -ne 0) { throw "msiexec /x exited $($p.ExitCode)" }
|
||||
if (Test-Path -LiteralPath $shortcuts[0]) { throw "uninstall left $($shortcuts[0]) behind" }
|
||||
Write-Output 'ok INSTALLDESKTOPSHORTCUT=0: Start Menu shortcut only'
|
||||
|
||||
test:
|
||||
name: test (native ARM64)
|
||||
|
||||
Reference in New Issue
Block a user