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".
ba538e1 to
3376eb0
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3376eb0089
ℹ️ 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".
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
3376eb0 to
2e26da4
Compare
|
@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 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1d5ca4a. Configure here.
| opts.version = None; | ||
| } else { | ||
| opts.version = Some(v); | ||
| } |
There was a problem hiding this comment.
Customize menu loses version on empty input
Low Severity
In show_customize_menu, pressing Enter (empty input) on the version prompt resets opts.version to None, silently discarding any value set via VP_VERSION env var or a prior customize entry. The user might expect empty input to keep the current value (shown as e.g. [alpha]), but instead it falls back to the default tag (latest). Unlike option 2's prompt which says "(or empty for default)", option 1's prompt gives no hint about this reset behavior.
Reviewed by Cursor Bugbot for commit 1d5ca4a. Configure here.
| install_dir: &AbsolutePathBuf, | ||
| target_version: &str, | ||
| resolved_version: &str, | ||
| has_previous: bool, |
There was a problem hiding this comment.
Redundant duplicate parameter in install_new_version function
Low Severity
install_new_version takes both target_version and resolved_version parameters, but at the call site they always receive the same value. target_version comes from resolve_version_string, and resolved_version comes from resolved.version which is just version.to_owned() in resolve_platform_package — the same version string passed in. Having two parameters for the same value adds unnecessary indirection and risks them diverging in future refactors.
Reviewed by Cursor Bugbot for commit 1d5ca4a. Configure here.
|
@shulaoda I have not used Windows in a long time, would you be able to review (and approve) this PR? |
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.
1d5ca4a to
9bb496d
Compare




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 that downloads/extracts binaries, installs deps, and edits the user PATH via registry, plus refactors
vp upgradeto share that logic; mistakes could break installs/upgrades on Windows. CI/release workflow changes also affect artifact packaging and release outputs.Overview
Adds a standalone Windows installer binary
vp-setup.exe(crates/vite_installer) that can run interactively or silently, downloads and verifies the platform tarball, installs deps, sets up shims/Node manager, and (on Windows) modifies the User PATH via registry.Extracts the existing
vp upgradeinstall plumbing into a new shared cratecrates/vite_setup(platform detection, npm registry resolution, integrity checks, extraction, link/junction swap, cleanup), and updatesvite_global_clito use this library and surfacevite_setuperrors.Updates CI and release workflows to build/cache/upload the installer for Windows targets, attach it to GitHub Releases, and adds a Windows job to validate installing via
vp-setup.exe; docs and Netlify redirects are updated to advertise the new download path.Reviewed by Cursor Bugbot for commit 1d5ca4a. Configure here.