# MeterAI installer for Windows. # irm https://meterai.myevent-labs.io | iex # Installs meterai.exe to %LOCALAPPDATA%\Programs\MeterAI and adds it to your # user PATH. No administrator rights needed. Re-run to update. # 0.1.0 and 6F73D0BE08398010DFE86B92961B1A12B166ABFDBD925F84DFFCD75C200CAD8E are filled in by scripts/publish-site.ps1. & { $ErrorActionPreference = 'Stop' $ProgressPreference = 'SilentlyContinue' # much faster downloads on Windows PowerShell 5.1 [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 $version = '0.1.0' $sha256 = '6F73D0BE08398010DFE86B92961B1A12B166ABFDBD925F84DFFCD75C200CAD8E' $url = 'https://meterai.myevent-labs.io/dl/meterai-windows-x64.exe' if (-not [Environment]::Is64BitOperatingSystem) { Write-Host 'MeterAI requires 64-bit Windows.' -ForegroundColor Red return } $dir = Join-Path $env:LOCALAPPDATA 'Programs\MeterAI' $exe = Join-Path $dir 'meterai.exe' $download = Join-Path $dir 'meterai.exe.download' New-Item -ItemType Directory -Force -Path $dir | Out-Null Write-Host "Downloading MeterAI $version..." -ForegroundColor Cyan try { Invoke-WebRequest -Uri $url -OutFile $download -UseBasicParsing } catch { Write-Host "Download failed: $($_.Exception.Message)" -ForegroundColor Red return } $actual = (Get-FileHash -Path $download -Algorithm SHA256).Hash if ($actual -ne $sha256) { Remove-Item $download -Force Write-Host 'Download failed verification (checksum mismatch). Nothing was installed. Please try again.' -ForegroundColor Red return } try { Move-Item -Path $download -Destination $exe -Force } catch { Remove-Item $download -Force -ErrorAction SilentlyContinue Write-Host 'MeterAI is currently running. Quit it (press q), then run the installer again.' -ForegroundColor Red return } $userPath = [Environment]::GetEnvironmentVariable('Path', 'User') $entries = @($userPath -split ';' | Where-Object { $_ }) if ($entries -notcontains $dir) { [Environment]::SetEnvironmentVariable('Path', (($entries + $dir) -join ';'), 'User') } if (@($env:Path -split ';') -notcontains $dir) { $env:Path = "$env:Path;$dir" } Write-Host '' Write-Host "MeterAI $version installed to $exe" -ForegroundColor Green Write-Host 'Run ' -NoNewline Write-Host 'meterai' -ForegroundColor Cyan -NoNewline Write-Host ' to open the dashboard. New terminals will find it automatically.' }