feat: Windows PowerShell installer (install.ps1)

Merged
MD
5mo ago
+643-5

What

Adds install.ps1 — a PowerShell installer for Windows that mirrors the macOS/Linux install bash script. It downloads the Bun-compiled standalone altimate.exe from GitHub releases (no npm/Node dependency) into %USERPROFILE%\.altimate\bin and adds it to the user PATH.

Advertised one-liner (symmetric with curl -fsSL https://www.altimate.sh/install | bash):

powershell -c "irm https://www.altimate.sh/install.ps1 | iex"

Why

Windows had no standalone install path — only npm install -g altimate-code, which requires Node and pulls the npm wrapper instead of the Bun executable. This brings full parity.

Details

  • Bun exe, not npm — pulls altimate-windows-x64.zip from GitHub releases and extracts altimate.exe.
  • Baseline parity — AVX2 detection via the same IsProcessorFeaturePresent(40) Win32 call the bash script uses; falls back to windows-x64-baseline.zip, plus a STATUS_ILLEGAL_INSTRUCTION retry that re-downloads the baseline build on AVX2 misdetection.
  • PATH — written to the user PATH via the registry (not setx) + WM_SETTINGCHANGE broadcast.
  • Upgrade-safe replace — renames the locked running .exe aside before moving the new one in (Windows locks running executables, unlike Unix mv).
  • altimate upgrade on native Windows — installation/index.ts now self-updates via irm install.ps1 | iex (no bash on native Windows); the "curl" upgrade branch dispatches on process.platform === "win32".
  • Docs — README, windows-wsl.md, troubleshooting.md advertise the one-liner and options (-Version, -NoPathUpdate, -ForceBaseline).
  • Tests — test/install/windows-install.test.ts + a branding block pin Bun-exe-not-npm, install dir, baseline detection/fallback, host consistency, and the win32 upgrade dispatch.

Follow-up (separate website/Amplify repo)

Add a 302 redirect https://www.altimate.sh/install.ps1 → https://raw.githubusercontent.com/AltimateAI/altimate-code/refs/heads/main/install.ps1, mirroring the existing /install redirect.

Verification

  • New tests pass; root bun typecheck passes (5/5).
  • Live pwsh parse and a real Windows install/upgrade run should be confirmed on a windows-latest runner (no pwsh on the dev host).

🤖 Generated with Claude Code


Summary by cubic

Adds a Windows PowerShell installer (install.ps1) to install the standalone altimate.exe to %USERPROFILE%\.altimate\bin, update PATH, and enable native Windows self-upgrade. Also adds WOW64-safe arch detection, a -Help flag, and Windows CI tests.

  • New Features
    • install.ps1 downloads altimate-windows-x64.zip (or -baseline) from GitHub releases and extracts altimate.exe — no npm/Node.
    • Detects AVX2 via IsProcessorFeaturePresent(40); falls back to baseline and retries on illegal-instruction; now resolves arch via PROCESSOR_ARCHITEW6432 under WOW64.
    • Safely replaces a running .exe; updates user PATH via the registry and broadcasts WM_SETTINGCHANGE.
    • altimate upgrade on native Windows runs the PS installer (irm https://www.altimate.sh/install.ps1 | iex).
    • Docs updated with the Windows one-liner and options (-Version, -NoPathUpdate, -ForceBaseline, -Help). Tests added (unit + Pester), and a Windows CI job runs Pester on windows-latest when install.ps1 or its tests change.

Summary by CodeRabbit

  • New Features

    • Added a Windows PowerShell standalone installer (install.ps1) with CPU-based AVX2 vs baseline selection and automatic fallback for illegal-instruction exits.
    • Updated the Windows upgrade flow to use the PowerShell installer with a preflight check for clearer download errors.
  • Documentation

    • Updated README install instructions with platform-specific commands.
    • Added Windows standalone troubleshooting for missing binaries and per-user PATH setup.
    • Expanded Windows-WSL docs with a “standalone install (no Node)” option.
  • Tests / CI

    • Added Pester/Bun test coverage for installer behavior and parity, plus a dedicated CI job for installer changes.