# VibeCode.surf installer for Windows. # # irm https://vibecode.surf/install.ps1 | iex # # Asks the VibeCode.surf service for the newest Windows installer and runs it for the current user. # Running it again later installs the newest version over the old one. Your projects, # chats and settings are kept: they live outside the app. # # Options (environment variables): # VIBECODE_VERSION install this version (for example 0.1.0) instead of the newest $ErrorActionPreference = 'Stop' $base = if ($env:VIBECODE_URL) { $env:VIBECODE_URL } else { 'https://vibecode.surf' } $version = if ($env:VIBECODE_VERSION) { $env:VIBECODE_VERSION } else { 'latest' } $appName = 'VibeCode.surf' $arch = if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { 'aarch64' } else { 'x86_64' } Write-Host "Looking up $appName for this computer..." [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 $answer = (Invoke-WebRequest -Uri "$base/api/install/windows/$arch`?version=$version" -UseBasicParsing).Content # The service answers in "key=value" lines. $info = @{} foreach ($line in ($answer -split "`n")) { $at = $line.IndexOf('=') if ($at -gt 0) { $info[$line.Substring(0, $at)] = $line.Substring($at + 1).Trim() } } if ($info['ok'] -ne '1') { throw $info['error'] } $name = if ($info['filename']) { $info['filename'] } else { 'VibeCode.surf-setup.exe' } $file = Join-Path ([IO.Path]::GetTempPath()) $name Write-Host "Downloading $appName $($info['version'])..." Invoke-WebRequest -Uri $info['url'] -OutFile $file -UseBasicParsing Write-Host 'Installing...' $setup = Start-Process -FilePath $file -ArgumentList '/S' -Wait -PassThru Remove-Item $file -ErrorAction SilentlyContinue if ($setup.ExitCode -ne 0) { throw "The installer stopped with code $($setup.ExitCode)." } Write-Host '' Write-Host "$appName $($info['version']) is installed. Find it in the Start menu." if ($info['message']) { Write-Host $info['message'] } Write-Host "Create your free account when the app opens, or at $base/app"