# Voidd installer for Windows (PowerShell 5.1+). # powershell -NoProfile -ExecutionPolicy Bypass -Command "iwr https://voidd.dev/install.ps1 -UseBasicParsing -OutFile $env:TEMP\voidd-install.ps1; & $env:TEMP\voidd-install.ps1" # Reads download/latest.json, picks the Setup installer for this CPU, verifies its SHA-256, installs it silently for the current user. # Env (for tests): VOIDD_BASE (download URL), VOIDD_ARCH, VOIDD_NO_RUN=1 (verify only, skip running the installer). $ErrorActionPreference = 'Stop' $ProgressPreference = 'SilentlyContinue' [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 function Install-Voidd { $base = if ($env:VOIDD_BASE) { $env:VOIDD_BASE } else { 'https://voidd.dev/download' } $arch = if ($env:VOIDD_ARCH) { $env:VOIDD_ARCH } elseif ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64' -or $env:PROCESSOR_ARCHITEW6432 -eq 'ARM64') { 'arm64' } else { 'x64' } Write-Host "==> Reading $base/latest.json" $manifest = Invoke-RestMethod -Uri "$base/latest.json" -UseBasicParsing $file = $manifest.files | Where-Object { $_.os -eq 'win' -and $_.kind -eq 'installer' -and $_.arch -eq $arch } | Select-Object -First 1 if (-not $file) { throw "No Windows installer for $arch in latest.json" } $dir = Join-Path ([IO.Path]::GetTempPath()) ("voidd-" + [Guid]::NewGuid().ToString('N')) New-Item -ItemType Directory -Path $dir | Out-Null try { $path = Join-Path $dir $file.name Write-Host "==> Downloading Voidd $($manifest.version) ($($file.name))" Invoke-WebRequest -Uri "$base/$($file.name)" -OutFile $path -UseBasicParsing Write-Host '==> Verifying SHA-256' $got = (Get-FileHash -Algorithm SHA256 -Path $path).Hash.ToLowerInvariant() if ($got -ne $file.sha256.ToLowerInvariant()) { throw "Checksum mismatch for $($file.name) (expected $($file.sha256), got $got). Nothing was installed." } if ($env:VOIDD_NO_RUN -eq '1') { Write-Host '==> Verified (VOIDD_NO_RUN=1, installer not run)'; return } Write-Host '==> Installing for the current user' $p = Start-Process -FilePath $path -ArgumentList '/S' -Wait -PassThru if ($p.ExitCode -ne 0) { throw "Installer exited with code $($p.ExitCode)" } Write-Host '==> Done. Open Voidd from the Start menu. If SmartScreen asks, choose More info, then Run anyway.' } finally { Remove-Item -Recurse -Force $dir -ErrorAction SilentlyContinue } } Install-Voidd