Skip to content

Commit a6b23a9

Browse files
committed
fix(installer): improve Windows asset download errors
1 parent 96b1d66 commit a6b23a9

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

vix-site/public/install.ps1

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,22 @@ function Download-And-Verify-Asset([string]$baseUrl, [string]$asset, [string]$tm
162162
$archivePath = Join-Path $tmpDir $asset
163163
$shaPath = Join-Path $tmpDir ($asset + ".sha256")
164164

165+
$assetUrl = "$baseUrl/$asset"
166+
$shaUrl = "$baseUrl/$asset.sha256"
167+
165168
Info "downloading $asset"
166169

167-
Invoke-WebRequest -Uri "$baseUrl/$asset" -OutFile $archivePath
168-
Invoke-WebRequest -Uri "$baseUrl/$asset.sha256" -OutFile $shaPath
170+
try {
171+
Invoke-WebRequest -Uri $assetUrl -OutFile $archivePath
172+
} catch {
173+
Die "release asset not found: $asset. Check that the GitHub release contains this file: $assetUrl"
174+
}
175+
176+
try {
177+
Invoke-WebRequest -Uri $shaUrl -OutFile $shaPath
178+
} catch {
179+
Die "checksum file not found: $asset.sha256. Check that the GitHub release contains this file: $shaUrl"
180+
}
169181

170182
Verify-Checksum $archivePath $shaPath
171183

@@ -217,8 +229,8 @@ function Install-Cli([string]$archivePath, [string]$tmpDir) {
217229
Select-Object -First 1
218230

219231
if (-not $exeCandidate) {
220-
Die "SDK archive does not contain $BinName"
221-
}
232+
Die "CLI archive does not contain $BinName"
233+
}
222234

223235
$exe = Join-Path $BinDir $BinName
224236

0 commit comments

Comments
 (0)