# Install scripts

The canonical non-interactive installers, served at the permanent URLs:

- **Linux:** <https://sabermage.github.io/spt-releases/install.sh>

  ```sh
  curl -fsSL https://sabermage.github.io/spt-releases/install.sh | sh
  ```

- **Windows:** <https://sabermage.github.io/spt-releases/install.ps1>

  ```powershell
  irm https://sabermage.github.io/spt-releases/install.ps1 | iex
  ```

## What they do

1. Resolve the latest release (or `SPT_INSTALL_VERSION`).
2. Download the platform binary and the release's `SHA256SUMS`.
3. **Verify the sha256** — a mismatch refuses before anything is placed.
4. Place the binary under the per-OS install root (`~/.local/bin` /
   `%LOCALAPPDATA%\spt-core\bin`).
5. Register the **user** PATH (at most once; idempotent re-runs).
6. Print the absolute installed path — on Windows the PATH change reaches
   **new** terminals only, so the first invocation in the current one uses
   that absolute path.

They run unattended (non-interactive by construction — they double as every
adapter's [pack-in installer](../harness-contract/install-on-demand.md)),
and re-running is always safe.

## Environment knobs

| Env var | Meaning |
|---|---|
| `SPT_INSTALL_VERSION` | Pin a release tag (default: latest) |
| `SPT_INSTALL_DIR` | Override the install directory |
| `SPT_INSTALL_REPO` | Override the source repo (default `SaberMage/spt-releases`) |
| `SPT_INSTALL_ASSET_BASE` | URL or local dir holding assets + `SHA256SUMS` directly (CI / air-gap / mirrors) |
| `SPT_INSTALL_NO_PATH` | `1` = skip PATH registration |

## Trust model

First fetch: HTTPS + GitHub + sha256 against the release's `SHA256SUMS`.
Thereafter `spt update` performs full Ed25519 verification against the
[two-key trust anchor](../self-update/overview.md#the-trust-chain) embedded
in the binary. MIT-licensed — copy them into your own bootstrap freely.

## OS-service registration

Not yet: the daemon auto-starts on any `spt` invocation, which covers
dev-stage use. Known gap until then: after a reboot, a node is unreachable
until something on it invokes `spt`. Service registration ships in a later
release.
