# Install Tavsin on Windows, in PowerShell: # # irm https://www.tavsin.xyz/install.ps1 | iex # # Downloads this release's Windows installer from www.tavsin.xyz, checks its # SHA-256 against https://www.tavsin.xyz/downloads/checksums.txt, and runs it # silently. Set TAVSIN_BASE_URL to install from another copy of the site. & { $ErrorActionPreference = 'Stop' $ProgressPreference = 'SilentlyContinue' $base = if ($env:TAVSIN_BASE_URL) { $env:TAVSIN_BASE_URL } else { 'https://www.tavsin.xyz' } if (-not [Environment]::Is64BitOperatingSystem) { throw 'Tavsin for Windows needs 64-bit Windows 10 or later.' } $sums = (Invoke-WebRequest -UseBasicParsing -Uri "$base/downloads/checksums.txt").Content if ($sums -is [byte[]]) { $sums = [Text.Encoding]::UTF8.GetString($sums) } $line = ($sums -split "`r?`n") | Where-Object { $_ -match '^[0-9a-f]{64} Tavsin-Setup-[0-9][0-9A-Za-z.]*\.exe$' } | Select-Object -First 1 if (-not $line) { throw 'This release has no Windows installer.' } $want, $name = $line -split ' ', 2 $dir = Join-Path ([IO.Path]::GetTempPath()) ('tavsin-' + [guid]::NewGuid()) New-Item -ItemType Directory -Path $dir | Out-Null try { $exe = Join-Path $dir $name Write-Host "Downloading $name" Invoke-WebRequest -UseBasicParsing -Uri "$base/downloads/windows" -OutFile $exe $got = (Get-FileHash -Path $exe -Algorithm SHA256).Hash.ToLowerInvariant() if ($got -ne $want) { throw "Checksum mismatch for $name (expected $want, got $got). Nothing was installed." } Write-Host 'Checksum matches. Installing...' $p = Start-Process -FilePath $exe -ArgumentList '/S' -Wait -PassThru if ($p.ExitCode -ne 0) { throw "The installer exited with code $($p.ExitCode)." } Write-Host 'Tavsin is installed. Open it from the Start menu.' } finally { Remove-Item -Recurse -Force -Path $dir -ErrorAction SilentlyContinue } }