Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ jobs:
run: ./packaging/windows/package.ps1 -Arch ${{ matrix.arch }}
- name: Install, run and uninstall the MSI
if: matrix.arch == 'x64'
timeout-minutes: 10
shell: pwsh
run: ./packaging/windows/test-install.ps1 -Path "dist/release/pdfcraft-$env:VERSION-windows-x64.msi" -ExpectedVersion $env:VERSION
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
Expand Down
5 changes: 5 additions & 0 deletions packaging/windows/test-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,21 @@ function Invoke-Msi([string[]] $Arguments) {
if ($process.ExitCode -ne 0) { throw "msiexec $($Arguments -join ' ') exited with $($process.ExitCode)" }
}

Write-Output 'Installing'
Invoke-Msi @('/i', "`"$msi`"", '/qn', '/norestart')
foreach ($path in $owned) {
if (-not (Test-Path -LiteralPath $path)) { throw "The install didn't create $path" }
}
$installed = (Get-ItemProperty -LiteralPath $key -Name InstallDir).InstallDir.TrimEnd('\')
if ($installed -ne $folder) { throw "InstallDir is '$installed', expected '$folder'" }

Write-Output 'Checking the CLI version'
$cli = Join-Path $folder 'pdfcraft-cli.exe'
$version = (& $cli --version) -join "`n"
if ($LASTEXITCODE -ne 0) { throw "pdfcraft-cli --version exited with $LASTEXITCODE" }
if ($version -notmatch [regex]::Escape($ExpectedVersion)) { throw "pdfcraft-cli reported '$version'" }

Write-Output 'Starting the app'
$app = Start-Process (Join-Path $folder 'pdfcraft.exe') -PassThru
$deadline = (Get-Date).AddSeconds(60)
do {
Expand All @@ -48,9 +51,11 @@ do {
} until ($app.MainWindowHandle -ne 0 -or (Get-Date) -gt $deadline)
if ($app.MainWindowHandle -eq 0) { throw 'pdfcraft.exe showed no window within 60 seconds' }
$title = $app.MainWindowTitle
Write-Output 'Stopping the app'
Stop-Process -Id $app.Id -Force
$app.WaitForExit()

Write-Output 'Uninstalling'
Invoke-Msi @('/x', "`"$msi`"", '/qn', '/norestart')
foreach ($path in $owned) {
if (Test-Path -LiteralPath $path) { throw "$path survived the uninstall" }
Expand Down
Loading