diff --git a/scripts/tauri/build-windows.ps1 b/scripts/tauri/build-windows.ps1 index 6994872d84..edb2fa27df 100644 --- a/scripts/tauri/build-windows.ps1 +++ b/scripts/tauri/build-windows.ps1 @@ -23,12 +23,22 @@ New-Item -ItemType Directory -Force .ci | Out-Null $final = ".ci/mqdh-$version-windows-x86_64-setup.exe" Copy-Item $setup.FullName $final node scripts/tauri/collect-installer.mjs --installer $final nsis x86_64-pc-windows-msvc -& $final /S +Write-Output "build-windows: silent install" +$install = Start-Process -FilePath $final -ArgumentList '/S' -PassThru +if (-not $install.WaitForExit(180000)) { $install.Kill(); throw 'NSIS silent install timed out' } $installed = Join-Path $env:LOCALAPPDATA 'MQDH\MQDH.exe' if (-not (Test-Path $installed)) { throw "per-user NSIS install not found: $installed" } -& $installed --version +$version = Start-Process -FilePath $installed -ArgumentList '--version' -PassThru -NoNewWindow +if (-not $version.WaitForExit(60000)) { $version.Kill(); throw 'installed --version timed out' } +Write-Output "build-windows: installed version command passed" $home = Join-Path $env:TEMP ("mqdh-smoke-" + [guid]::NewGuid()) $env:MQDH_HOME = $home -& $installed --smoke -if (Test-Path $installed) { & (Join-Path $env:LOCALAPPDATA 'MQDH\uninstall.exe') /S } +$smoke = Start-Process -FilePath $installed -ArgumentList '--smoke' -PassThru -NoNewWindow +if (-not $smoke.WaitForExit(300000)) { $smoke.Kill(); throw 'installed backend --smoke timed out' } +if ($smoke.ExitCode -ne 0) { throw "installed backend --smoke failed: $($smoke.ExitCode)" } +$uninstall = Join-Path (Split-Path $installed) 'uninstall.exe' +if (Test-Path $uninstall) { + $remove = Start-Process -FilePath $uninstall -ArgumentList '/S' -PassThru + if (-not $remove.WaitForExit(120000)) { $remove.Kill(); throw 'NSIS uninstall timed out' } +} Write-Output "build-windows: OK $final"