# Installs gelato for the current user: # irm https://raw.githubusercontent.com/usegelato/gelato/main/install.ps1 | iex # Downloads the latest release, checks its SHA-256 against the digest GitHub publishes and # runs `gelato setup`, which copies it to \apps\gelato\current, adds the shims # folder to PATH and adds the main bucket. No admin rights needed. $ErrorActionPreference = 'Stop' $target = if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64' -or $env:PROCESSOR_ARCHITEW6432 -eq 'ARM64') { 'aarch64-pc-windows-msvc' } else { 'x86_64-pc-windows-msvc' } $name = "gelato-$target.zip" $release = Invoke-RestMethod 'https://api.github.com/repos/usegelato/gelato/releases/latest' $asset = $release.assets | Where-Object name -EQ $name if (-not $asset) { throw "release $($release.tag_name) has no $name" } if ($asset.digest -notmatch '^sha256:([0-9a-f]{64})$') { throw "no SHA-256 digest published for $name" } $expected = $Matches[1] $work = Join-Path ([IO.Path]::GetTempPath()) "gelato-install-$([guid]::NewGuid())" New-Item -ItemType Directory $work | Out-Null try { $zip = Join-Path $work $name Invoke-WebRequest $asset.browser_download_url -OutFile $zip -UseBasicParsing $actual = (Get-FileHash $zip -Algorithm SHA256).Hash.ToLower() if ($actual -ne $expected) { throw "hash mismatch for ${name}: expected $expected, got $actual" } Expand-Archive $zip -DestinationPath $work & (Join-Path $work 'gelato.exe') setup if ($LASTEXITCODE -ne 0) { throw "gelato setup failed ($LASTEXITCODE)" } } finally { Remove-Item -Recurse -Force $work }