# RezoGram for Windows: one-line install # # irm https://zpas.org/install.ps1 | iex # # What this script does (read it before running anything from the internet): # 1. Reads the official release list from https://zpas.org/api/app-releases.json # 2. Downloads the installer only from RezoGram's official GitHub releases # 3. Checks its SHA-256 against the official value; a single changed byte stops the install # 4. Installs it for your Windows user only (no administrator rights), then deletes the downloaded file # 5. Adds a desktop shortcut and opens RezoGram # It sends nothing about you anywhere. & { $ErrorActionPreference = 'Stop' $ProgressPreference = 'SilentlyContinue' # much faster downloads in Windows PowerShell 5 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 function Say($text, $color = 'Gray') { Write-Host " $text" -ForegroundColor $color } Write-Host '' Write-Host ' RezoGram ' -ForegroundColor Cyan -NoNewline Write-Host '- private by design' -ForegroundColor DarkGray Write-Host '' if ($env:OS -ne 'Windows_NT') { Say 'This installer is for Windows. See https://zpas.org/download' 'Yellow'; return } Say 'Checking the latest official release...' $release = (Invoke-RestMethod -Uri 'https://zpas.org/api/app-releases.json' -UseBasicParsing).platforms.windows if (-not $release -or -not $release.published -or -not $release.downloadAvailable) { Say 'No Windows release is available right now. Please try again later.' 'Yellow'; return } $url = [string]$release.assetUrl $expected = ([string]$release.sha256).ToLowerInvariant() if ($url -notmatch '^https://github\.com/passgram/PassGram/releases/' -or $url -notmatch '\.exe$' -or $expected -notmatch '^[0-9a-f]{64}$') { throw 'The release information does not point to an official RezoGram installer. Nothing was installed.' } $file = Join-Path $env:TEMP ("RezoGram-Setup-" + $expected.Substring(0, 12) + ".exe") Say ("Downloading RezoGram {0} ({1:N0} MB)..." -f $release.version, ($release.sizeBytes / 1MB)) Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing Say 'Verifying the file...' $actual = (Get-FileHash -Path $file -Algorithm SHA256).Hash.ToLowerInvariant() if ($actual -ne $expected) { Remove-Item $file -Force -ErrorAction SilentlyContinue throw "The downloaded file does not match the official SHA-256. It was deleted and nothing was installed." } Say "Verified $actual" 'Green' # Close a running copy so the update can replace its files. Get-Process -Name 'RezoGram', 'PassGram' -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue Say 'Installing...' try { $p = Start-Process -FilePath $file -ArgumentList '/quiet' -Wait -PassThru # 1638 = this version is already installed if ($p.ExitCode -ne 0 -and $p.ExitCode -ne 3010 -and $p.ExitCode -ne 1638) { throw "The installer stopped with code $($p.ExitCode). Nothing else was changed." } } finally { Remove-Item $file -Force -ErrorAction SilentlyContinue } $exe = Join-Path $env:LOCALAPPDATA 'RezoGram\RezoGram.exe' if (-not (Test-Path $exe)) { Write-Host '' Say 'The installation did not finish. Run the command again any time.' 'Yellow' Write-Host '' return } # Desktop shortcut: replace old PassGram / Z Pass shortcuts with one RezoGram shortcut. $desktop = [Environment]::GetFolderPath('Desktop') foreach ($old in "$desktop\PassGram.lnk", "$desktop\Z Pass.lnk") { Remove-Item $old -Force -ErrorAction SilentlyContinue } try { $shell = New-Object -ComObject WScript.Shell $lnk = $shell.CreateShortcut("$desktop\RezoGram.lnk") $lnk.TargetPath = $exe $lnk.WorkingDirectory = Split-Path $exe $lnk.IconLocation = "$exe,0" $lnk.Description = 'RezoGram - private by design' $lnk.Save() Say 'Added a RezoGram shortcut to your desktop.' } catch { Say 'Could not add a desktop shortcut (you can pin RezoGram from the Start menu).' 'DarkGray' } Say 'Opening RezoGram...' Start-Process -FilePath $exe -WorkingDirectory (Split-Path $exe) Write-Host '' Say 'Done. RezoGram is ready.' 'Green' Write-Host '' }