# Installs or updates Instant Answer on Windows (PowerShell): # irm https://instant-answer.werkstatt.works/install.ps1 | iex # # The installer isn't code signed, so a browser download triggers a SmartScreen warning. Files # downloaded by PowerShell aren't marked as coming from the internet, so it runs without one. $ErrorActionPreference = 'Stop' $ProgressPreference = 'SilentlyContinue' # Invoke-WebRequest is very slow with the progress bar. $site = 'https://instant-answer.werkstatt.works' $platform = 'windows-x86_64' if (-not [Environment]::Is64BitOperatingSystem) { throw 'Instant Answer needs 64-bit Windows.' } $manifest = Invoke-RestMethod "$site/downloads/$platform/latest.json" $installer = Join-Path ([IO.Path]::GetTempPath()) "InstantAnswerSetup-$($manifest.version).exe" Write-Host "Downloading Instant Answer $($manifest.version)..." Invoke-WebRequest $manifest.platforms.$platform.url -OutFile $installer -UseBasicParsing Write-Host 'Installing...' # /P: passive, shows progress only. Installs for the current user, no administrator rights needed. Start-Process $installer -ArgumentList '/P' -Wait Remove-Item $installer -ErrorAction SilentlyContinue $app = Join-Path $env:LOCALAPPDATA 'Instant Answer\instant-answer.exe' if (Test-Path $app) { Start-Process $app Write-Host "Installed Instant Answer $($manifest.version). It runs in the system tray and updates itself from now on." } else { Write-Host "Installed Instant Answer $($manifest.version). Start it from the Start menu." }