aboutsummaryrefslogtreecommitdiff
path: root/website/install.ps1
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-08-07 14:40:14 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-08-07 14:40:14 +0300
commit322ab6a5a98db5c230b7c90881b8b4baf4cee624 (patch)
treea64ad1b46bc0ef0a0748ccad8409c5e7e97cb7ae /website/install.ps1
parent69a07fdf061a35276295189d52d591893c429806 (diff)
fix: verify stable release checksums
Diffstat (limited to 'website/install.ps1')
-rw-r--r--website/install.ps117
1 files changed, 12 insertions, 5 deletions
diff --git a/website/install.ps1 b/website/install.ps1
index e5842dc8..b7ea80aa 100644
--- a/website/install.ps1
+++ b/website/install.ps1
@@ -154,12 +154,21 @@ function Get-ManifestAsset {
throw "Release manifest does not include a binary for $Target."
}
+ $sha256 = $null
+ $shaMapProperty = $Manifest.PSObject.Properties["sha256"]
+ if ($null -ne $shaMapProperty -and $null -ne $shaMapProperty.Value) {
+ $targetShaProperty = $shaMapProperty.Value.PSObject.Properties[$Target]
+ if ($null -ne $targetShaProperty -and -not [string]::IsNullOrWhiteSpace([string]$targetShaProperty.Value)) {
+ $sha256 = [string]$targetShaProperty.Value
+ }
+ }
+
$asset = $property.Value
if ($asset -is [string]) {
$url = [string]$asset
return [PSCustomObject]@{
Url = $url
- Sha256 = $null
+ Sha256 = $sha256
Format = if ($url.EndsWith(".zip", [System.StringComparison]::OrdinalIgnoreCase)) { "zip" } else { "exe" }
}
}
@@ -180,10 +189,8 @@ function Get-ManifestAsset {
throw "Release manifest asset $Target has unsupported format '$format'."
}
$shaProperty = $asset.PSObject.Properties["sha256"]
- $sha256 = if ($null -eq $shaProperty -or [string]::IsNullOrWhiteSpace([string]$shaProperty.Value)) {
- $null
- } else {
- [string]$shaProperty.Value
+ if ($null -ne $shaProperty -and -not [string]::IsNullOrWhiteSpace([string]$shaProperty.Value)) {
+ $sha256 = [string]$shaProperty.Value
}
return [PSCustomObject]@{