Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,9 @@ For a pinned version or custom user-writable directory:

The installer verifies the published `.zip.sha256` before extraction, installs
both `wright.exe` and `wright-lsp.exe`, and runs both binaries directly for a
version smoke check. If the install directory is not already on the user
`PATH`, it prints a copyable PowerShell command and asks you to open a new
version smoke check. If the default install directory is not already on the
user `PATH`, it adds it and updates the current session; with a custom
`-InstallDir` it prints a copyable PowerShell command and asks you to open a new
terminal. It does not require Cargo, npm, or a source checkout.

### Release smoke test
Expand Down Expand Up @@ -336,8 +337,9 @@ by `scripts/test-install.sh` against a mock R2 route on Linux and macOS CI.
stable release by default or an exact `-Version`, downloads the canonical ZIP
and matching `.sha256`, verifies the checksum before extraction, installs both
executables into the user-writable default directory or `-InstallDir`, and
runs a direct native version smoke check. When needed, it prints an actionable
user `PATH` update instruction. Its functional behavior is covered by
runs a direct native version smoke check. When needed, it adds the default
directory to the user `PATH`, or prints an actionable update instruction for a
custom `-InstallDir`. Its functional behavior is covered by
`scripts/test-install.ps1` against a local test release server on Windows.


Expand Down
18 changes: 13 additions & 5 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ if ($OsArchitecture -ne "AMD64") {

$BaseUrl = Resolve-Setting $BaseUrl "WRIGHT_INSTALL_BASE_URL" "https://install.wrightkit.dev/wright"
$Version = Get-Version $Version $BaseUrl
if (-not $InstallDir) {
$DefaultInstallDir = -not $InstallDir
if ($DefaultInstallDir) {
$InstallRoot = if ($env:LOCALAPPDATA) { $env:LOCALAPPDATA } else { $env:USERPROFILE }
if (-not $InstallRoot) { Fail "could not determine a user-writable install directory; pass -InstallDir" }
$InstallDir = Join-Path $InstallRoot "Programs\Wright\bin"
Expand Down Expand Up @@ -175,10 +176,17 @@ try {
$_.Trim().TrimEnd("\") -ieq $PathEntry
}).Count -gt 0
if (-not $PathContainsInstallDir) {
$DisplayPath = $InstallDir.Replace("'", "''")
Write-Host "note: '$InstallDir' is not on your user PATH; add it and open a new terminal to use wright by name:"
Write-Host " `$userPath = [Environment]::GetEnvironmentVariable('Path', 'User')"
Write-Host " [Environment]::SetEnvironmentVariable('Path', (`$userPath.TrimEnd(';') + ';$DisplayPath'), 'User')"
if ($DefaultInstallDir) {
$NewUserPath = (@($PathEntries | Where-Object { $_.Trim() }) + $PathEntry) -join ";"
[Environment]::SetEnvironmentVariable("Path", $NewUserPath, "User")
$env:Path = "$env:Path;$PathEntry"
Write-Host "==> added '$PathEntry' to your user PATH; terminals opened from now on can run wright"
} else {
$DisplayPath = $InstallDir.Replace("'", "''")
Write-Host "note: '$InstallDir' is not on your user PATH; add it and open a new terminal to use wright by name:"
Write-Host " `$userPath = [Environment]::GetEnvironmentVariable('Path', 'User')"
Write-Host " [Environment]::SetEnvironmentVariable('Path', (`$userPath.TrimEnd(';') + ';$DisplayPath'), 'User')"
}
}
Write-Host "==> done: wright and wright-lsp $Version installed in $InstallDir"
} finally {
Expand Down
Loading