Repository navigation
feat(install): add Windows PowerShell installer - #579
Merged
Merged
Conversation
SaladDay
marked this pull request as ready for review
November 24, 2026 12:56
- point the README one-liner at main so it works once merged, and drop the unused release upload - keep the existing user PATH value kind - warn instead of failing when the PATH broadcast fails - remove the staged .new file on any copy or move failure - keep the trailing backslash of a drive-root install dir - tell users to delete an old System32 copy - add timeout and concurrency to the smoke workflow
- move the old exe aside before moving the new one in, restore it if that fails, and only say nothing was overwritten when that is true - stop early in Constrained Language mode and on install dirs with ';' - open the Environment key with CreateSubKey - show PowerShell syntax for the installer env vars in the READMEs - assert the real failed-replace path, leftovers and temp cleanup in CI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
install.shexits on Windows, and the README tells Windows users to movecc-switch.exeintoC:\Windows\System32, which needs administrator rights (#525).Behavior
cc-switch-cli-windows-x64.zipfromreleases/latest/download(no GitHub API), or the tag inCC_SWITCH_VERSION(5.11.3andv5.11.3both work).cc-switch.exeto%LOCALAPPDATA%\cc-switch, orCC_SWITCH_INSTALL_DIR.install.sh: prompt when interactive, refuse in non-interactive shells unlessCC_SWITCH_FORCE=1.%VAR%entries stay unexpanded and the value keeps its registry kind (REG_EXPAND_SZwhen new). Updates the current session PATH, notifies new terminals (a failed notification only warns), then runscc-switch --version.cc-switch.exeis replaced; its backup is removed by the next install.;.iexleaves no variables or preference changes in the caller's session.The script is served from
main, so the one-liner works as soon as this merges and no release asset is needed. The three READMEs show the one-liner, drop the System32 step, and tell users to delete an old System32 copy.Not included: Windows daemon /
start, source builds, checksum verification (install.shhas none either).Verification
New
Install scriptworkflow (runs only wheninstall.ps1, a README or the workflow changes) runs the checked-out script against the real releases onwindows-2022, in bothpowershellandpwsh: run https://github.com/SaladDay/cc-switch-cli/actions/runs/45402541957It covers a fresh install via
iex, PATH dedup and an unexpanded%USERPROFILE%entry, refusal withoutCC_SWITCH_FORCE, a forced overwrite of a stale exe, a locked exe (original kept, no leftovers or temp dirs), a running v5.11.3cc-switch proxy servereplaced by the latest release, an install dir with;, a missing release, a custom dir with a pinned version, aREG_SZuser PATH, a missing user PATH value, a failed PATH broadcast, a drive-root install dir, and the README one-liner itself (pointed at the PR commit instead ofmain).Closes #525