diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0fbcaa4d7d..9a45d0a1fc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/packaging/windows/test-install.ps1 b/packaging/windows/test-install.ps1 index 9473c6a355..2f624b2833 100644 --- a/packaging/windows/test-install.ps1 +++ b/packaging/windows/test-install.ps1 @@ -27,6 +27,7 @@ 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" } @@ -34,11 +35,13 @@ foreach ($path in $owned) { $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 { @@ -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" }