Repository navigation
feat(cli): Add a PowerShell installer for Windows - #1511
sentry-junior[bot] wants to merge 4 commits into
Conversation
Serve install.ps1 from cli.sentry.dev so Windows users can install the standalone binary with `irm https://cli.sentry.dev/install.ps1 | iex` without Git Bash or WSL. Refs #1510 Co-Authored-By: Burak Yigit Kaya <burak.kaya@sentry.io>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Somewhat crazy idea: how much of this you can abstract so we don't duplicate logic between install.sh and install.ps1? Maybe with like a common syntax, AST, replacing template etc? Because we want to avoid drift between these two. |
|
Short version: I wouldn't build a shared syntax, AST, or transpiler. I'd make both scripts thin enough that there's very little left to drift. Why not codegen. The duplicated parts are exactly where bash and PowerShell differ most: HTTP status handling, error and exit semantics, gzip, and pipes. Generated output would also be harder to audit, and people do read install scripts before piping them into a shell. What actually removes the duplication. The release registry already returns everything both scripts work out by hand:
Each script could then shrink to the same five steps:
That deletes the paginated GitHub release scan, the toolkit-vs-legacy tag probing, and the legacy Two smaller pieces:
Happy to do this either as part of this PR (bash + ps1 together) or as a follow-up that slims |
Let's do it here in this PR. |
Both installers now take the version, download URL, and sha256 checksum for each asset from Sentry's release registry, which covers legacy getsentry/cli releases too. The GitHub tag probing and legacy fallbacks are gone; GitHub is only an unverified fallback while the registry is unreachable. A shared scenario table runs against both scripts so their behavior cannot drift. Refs #1510
BYK
left a comment
There was a problem hiding this comment.
Just gonna assume this works. Maybe have a smoke test for this in a Windows runner in GitHub Actions?
|
Done in this PR, as discussed:
Install-dir resolution and Windows PATH editing still live in the scripts rather than in The PR description above is out of date: it still describes the old GitHub-based version lookup. |
File this as an issue and start working on it.
Update it then and then merge the PR when CI passes and no review comments left. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9c94663. Configure here.

Windows users can now install the standalone CLI without Git Bash or WSL:
To keep
installandinstall.ps1from drifting, both now resolve releases the same way. They ask Sentry's release registry (apps/sentry/{latest|<version>}) for the version, the download URL and the sha256 checksum of the asset. The registry covers oldgetsentry/clireleases too, so the GitHub tag probing and the legacy fallbacks are gone from the bash installer. Downloads are now checksum-verified, preferring.gzand falling back to the raw asset. GitHub is only used, unverified and with a warning, when the registry is unreachable. A shared scenario table (test/lib/install-scenarios.ts) runs against both scripts with the same mock contract, so any behavior difference fails CI.install.ps1hands off tosentry cli setup --install --method curl, sosentry cli upgradekeeps working. Setup only edits POSIX shell rc files, so for now the installer adds the install dir to the userPATHitself. It writes the registry value asREG_EXPAND_SZso existing%VAR%entries are kept, and it also writes toGITHUB_PATHin Actions. It readsSENTRY_VERSION,SENTRY_INSTALL_DIR,SENTRY_INIT,SENTRY_NO_MODIFY_PATH, andSENTRY_CLI_NO_TELEMETRY. All the code runs inside a function, so running it throughiexdoesn't change the caller's preferences, and failures throw instead of callingexit.The new
Install Scriptsworkflow smoke-testsinstall.ps1on real Windows runners. It installs latest with Windows PowerShell 5.1 and with PowerShell 7, and installs pinned legacy0.42.2with PowerShell 7. It checkssentry --versionand thatsentryis onPATHin a later step.Scope decisions:
sentry cli upgrade nightly) and x64-only.sentry cli setupis a follow-up.The docs site serves the script through a
public/install.ps1symlink. The landing page selector gets apowershelloption, and the getting-started page gets a Windows section.Closes #1510
via byk.
--
View Junior Session [Sentry]