feat(installer): add standalone Windows .exe installer (vp-setup.exe)#1293
feat(installer): add standalone Windows .exe installer (vp-setup.exe)#1293
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
How to use the Graphite Merge QueueAdd the label auto-merge to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
1b3a6a3 to
4dc36b5
Compare
672909f to
816d7f1
Compare
4fe6fd3 to
a87b42c
Compare
Manual Testing Plan:
|
This comment was marked as outdated.
This comment was marked as outdated.
a8c95ab to
aa5dfc2
Compare
This comment was marked as outdated.
This comment was marked as outdated.
e88ee5c to
29f821e
Compare
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 29f821e61f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e26da4d31
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This comment was marked as resolved.
This comment was marked as resolved.
2b0a367 to
2e2720b
Compare
|
@cpojer When you have a time, please take a look at this new feature 😉 |
This comment was marked as resolved.
This comment was marked as resolved.
|
@cursor review |
d49974c to
1d5ca4a
Compare
|
@cursor review |
|
@shulaoda I have not used Windows in a long time, would you be able to review (and approve) this PR? |
1d5ca4a to
9bb496d
Compare
Add a standalone `vp-setup.exe` Windows installer that installs the vp CLI without requiring PowerShell, complementing the existing `install.ps1`. Architecture: - New `vite_setup` shared library crate extracting installation logic (platform detection, registry queries, integrity verification, tarball extraction, symlink/junction management) from `vite_global_cli` - New `vite_installer` binary crate producing `vp-setup.exe` Features: - Interactive menu with customize submenu (version, registry, Node.js manager, PATH modification) - Silent mode via `-y` or auto-detected CI environment - Node.js manager auto-detection matching install.ps1/install.sh logic - Same-version repair (skips download, reruns post-activation setup) - Windows PATH modification via `winreg` crate - DLL security mitigations (build.rs linker flag + runtime SetDefaultDllDirectories) - ANSI color support with fallback for legacy Windows consoles - Respects NO_COLOR env var - Post-activation steps are best-effort (non-fatal) - "Press Enter to close..." pause in interactive mode - VP_HOME propagated to child processes for custom install dirs CI: - Build + cache installer in release workflow - Attach as GitHub Release assets - Test job in test-standalone-install.yml Docs: - RFC at rfcs/windows-installer.md - Installation guide updated with vp-setup.exe download link - SmartScreen warning guide added Closes #1293
…tion_deps The silent parameter gates the release-age fallback prompt. Using opts.quiet meant that -y without -q would still show the prompt, blocking unattended installs. Use opts.yes so non-interactive mode correctly suppresses all prompts.
…oss-compile - Move VP_HOME set_var and resolve_install_dir to main() before the tokio multi-thread runtime is created, ensuring no other threads can race on env var access (fixes UB safety concern). - Use CARGO_CFG_TARGET_OS in build.rs instead of #[cfg(windows)] so the DLL security linker flag is correctly emitted when cross-compiling from a non-Windows host to a Windows target.
Extract install steps into install_new_version() helper so the caller can remove the partial version directory on failure, matching the vp upgrade behavior. Without this, a failed extraction or dependency install would leave a corrupted directory that wastes disk space and could interfere with retries.
9bb496d to
c7f59c6
Compare
…input - Merge target_version and resolved_version into single version param in install_new_version (they always had the same value at call site) - Empty input on version prompt now keeps the current value instead of resetting to the default tag
|
@cursor review |
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 bfaa80f. Configure here.
…rror Replace unwrap_or_default() with explicit error matching: only treat ERROR_FILE_NOT_FOUND as empty PATH (fresh user with no custom PATH). Any other error (corrupt data, wrong type, permission issue) is now propagated, preventing the installer from silently replacing the user's entire PATH with just the vp bin directory.



Add a standalone
vp-setup.exeWindows installer binary that installsthe vp CLI without requiring PowerShell, complementing the existing
irm https://vite.plus/ps1 | iexscript-based installer.vite_setupshared library crate extracting installation logic(platform detection, registry queries, integrity verification, tarball
extraction, symlink/junction management) from
vite_global_clivite_installerbinary crate producingvp-setup.exewithinteractive prompts, silent mode (-y), progress bars, and Windows PATH
modification via direct registry API (no PowerShell dependency)
vite_global_clito usevite_setupinstead of inline upgrademodules, ensuring upgrade and installer share identical logic
as GitHub Release assets
Note
Medium Risk
Adds a new Windows installer binary that performs downloads, filesystem/link manipulation, and registry PATH updates, plus refactors
vp upgradeto share that code; failures could impact Windows install/upgrade behavior and release packaging.Overview
Introduces a standalone Windows installer (
vp-setup.exe) with interactive and silent modes that downloads the correct platform tarball, verifies integrity, installs dependencies, sets up shims/Node manager, and (on Windows) updates the user PATH via registry.Extracts the existing
vp upgradeinstall pipeline into a new shared cratevite_setup, and switchesvite_global_cliupgrade + upgrade-check to use it (including unified errors/constants and new helpers likeread_current_version/create_env_files).Updates CI/release workflows to build, cache, test, and attach
vp-setup.exeartifacts to GitHub Releases, and updates docs + Netlify redirect to advertise the new installer.Reviewed by Cursor Bugbot for commit bfaa80f. Configure here.