Repository navigation
feat(cli): Add a PowerShell installer for Windows - #1511
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.
Run the bash installer on Ubuntu and macOS runners alongside the Windows PowerShell jobs, and trigger the workflow on changes to either script. Drop the pinned legacy getsentry/cli release job and shared scenario.

Windows users can install the standalone CLI without Git Bash or WSL:
Both
installandinstall.ps1resolve stable releases through Sentry's release registry (apps/sentry/{latest|<version>}), which provides the version, asset URLs, and SHA-256 checksums. Both prefer the.gzasset and fall back to the raw binary if that asset is unavailable; registry outages fall back to GitHub with a warning (those fallback downloads are not checksum-verified). A shared scenario table inpackages/cli/test/lib/install-scenarios.tsexercises both installers against the same behavior cases.install.ps1hands off tosentry cli setup --install --method curl, then manages the Windows userPATHitself because setup currently edits POSIX shell rc files only. It preserves existing%VAR%entries, writes toGITHUB_PATHin Actions, and honorsSENTRY_VERSION,SENTRY_INSTALL_DIR,SENTRY_INIT,SENTRY_NO_MODIFY_PATH, andSENTRY_CLI_NO_TELEMETRY. The script runs inside a function soirm | iexdoes not change caller preferences or close the terminal on failure.The
Install Scriptsworkflow smoke-tests both installers on real runners when either installer or the workflow changes: bash on Ubuntu and macOS, and PowerShell on Windows PowerShell 5.1 and PowerShell 7. Each job verifiessentry --versionand that a later step can findsentryonPATH.Scope:
sentry cli upgrade nightlyfor nightly.sentry cli setupremains a follow-up.The docs site serves
install.ps1; the landing page install selector and getting-started guide include the Windows PowerShell option.Closes #1510
via byk.
--
View Junior Session [Sentry]