# VizForge local companion: Windows helper. Read it before you run it. # # irm https://vizforge.ai/install.ps1 | iex # # What it does, and nothing else: # 1. checks that Node.js 20 or newer is installed (it does not install Node.js); # 2. checks that the npm package is the reviewed VizForge release # (its npm integrity hash must equal $Integrity below); # 3. runs: npx --yes vizforge@ init # # It needs no administrator rights and changes nothing itself. `vizforge init` # lists every file it changes and backs each one up first; undo it with # npx vizforge uninstall # Same command on macOS and Linux: npx vizforge init $ErrorActionPreference = 'Stop' $Package = 'vizforge' $Version = '0.1.0' # npm "dist.integrity" of $Package@$Version. 'UNPUBLISHED' until the release # is on npm; then the publisher pastes the value here (PUBLISHING.md step 6). $Integrity = 'UNPUBLISHED' $NodeMin = 20 if ($Integrity -eq 'UNPUBLISHED') { Write-Host "VizForge's companion is not published on npm yet, so there is nothing to install." Write-Host 'See https://vizforge.ai/cli for the release, and the free browser tools you can use today.' return } $node = Get-Command node -ErrorAction SilentlyContinue if (-not $node) { Write-Host "Node.js $NodeMin or newer is needed. Install the LTS from https://nodejs.org, open a new PowerShell window and run this again." return } $major = [int]((& node -p 'process.versions.node.split(".")[0]').Trim()) if ($major -lt $NodeMin) { Write-Host "Node.js $NodeMin or newer is needed (this PC has $(& node --version)). Update it from https://nodejs.org and run this again." return } $published = (& npm view "$Package@$Version" dist.integrity 2>$null | Out-String).Trim() if ($published -ne $Integrity) { Write-Host "Stopped: npm's $Package@$Version is not the reviewed VizForge release (integrity mismatch). Nothing was run." return } Write-Host "Running: npx --yes $Package@$Version init" & npx --yes "$Package@$Version" init