diff options
| author | JJ Liebig <jonathan.liebig@gmail.com> | 2026-08-14 21:48:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-14 22:48:59 +0300 |
| commit | cb727d055545b5b2fc366f778e4c57874d0aa8c1 (patch) | |
| tree | 112a6b2ca98c807eeb376c76764e34fb2acef5c9 /scripts | |
| parent | d76657f2c7fc18dcce3b9af43842c8afaba1646b (diff) | |
fix: use verified local packages for windows updates (#2816)
refs #2751
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/windows_install_conpty_package_test.ps1 | 54 |
1 files changed, 50 insertions, 4 deletions
diff --git a/scripts/windows_install_conpty_package_test.ps1 b/scripts/windows_install_conpty_package_test.ps1 index 0da92989..4b0e73f3 100644 --- a/scripts/windows_install_conpty_package_test.ps1 +++ b/scripts/windows_install_conpty_package_test.ps1 @@ -113,10 +113,56 @@ try { } } - & "$PSScriptRoot\..\website\install.ps1" ` - -ManifestUrl $manifestUrl ` - -InstallDir $installDir ` - -ExpectedBuildId "installer-test" + # Keep the existing positional web-installer contract, including Retain in slot five. + & "$PSScriptRoot\..\website\install.ps1" "preview" $manifestUrl $installDir "installer-test" 3 + + $localInstallDir = Join-Path $root "local-bin" + $env:HERDR_HOME = Join-Path $root "local-home" + $partialLocalModeRejected = $false + try { + & $installerPath ` + -InstallDir $localInstallDir ` + -LocalPackagePath $archive + } catch { + if ($_.Exception.Message -notlike "Local package mode requires*") { + throw + } + $partialLocalModeRejected = $true + } + if (-not $partialLocalModeRejected) { + throw "installer accepted partial local-package inputs" + } + + $badLocalChecksumRejected = $false + try { + & $installerPath ` + -ManifestUrl "$manifestUrl/unused" ` + -InstallDir $localInstallDir ` + -LocalPackagePath $archive ` + -LocalPackageFormat "zip" ` + -LocalPackageIdentity "0.0.0-preview.local-package" ` + -LocalPackageSha256 ("0" * 64) + } catch { + if ($_.Exception.Message -notlike "Downloaded Herdr checksum did not match.*") { + throw + } + $badLocalChecksumRejected = $true + } + if (-not $badLocalChecksumRejected) { + throw "installer accepted a local package with the wrong checksum" + } + + & $installerPath ` + -ManifestUrl "$manifestUrl/unused" ` + -InstallDir $localInstallDir ` + -LocalPackagePath $archive ` + -LocalPackageFormat "zip" ` + -LocalPackageIdentity "0.0.0-preview.local-package" ` + -LocalPackageSha256 $hash + if (-not (Test-Path -LiteralPath (Join-Path $localInstallDir "herdr.exe") -PathType Leaf)) { + throw "installer did not activate the verified local package" + } + $env:HERDR_HOME = $herdrHome $required = @( "herdr.exe", |
