Skip to content

feat(installer): add standalone Windows .exe installer (vp-setup.exe)#1293

Open
fengmk2 wants to merge 4 commits intomainfrom
windows-installer
Open

feat(installer): add standalone Windows .exe installer (vp-setup.exe)#1293
fengmk2 wants to merge 4 commits intomainfrom
windows-installer

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented Apr 4, 2026

Add a standalone vp-setup.exe Windows installer binary that installs
the vp CLI without requiring PowerShell, complementing the existing
irm https://vite.plus/ps1 | iex script-based installer.

  • Create vite_setup shared library crate extracting installation logic
    (platform detection, registry queries, integrity verification, tarball
    extraction, symlink/junction management) from vite_global_cli
  • Create vite_installer binary crate producing vp-setup.exe with
    interactive prompts, silent mode (-y), progress bars, and Windows PATH
    modification via direct registry API (no PowerShell dependency)
  • Update vite_global_cli to use vite_setup instead of inline upgrade
    modules, ensuring upgrade and installer share identical logic
  • Add CI build/upload steps for installer in release workflow, attached
    as GitHub Release assets
  • Add RFC document at rfcs/windows-installer.md

Note

Medium Risk
Adds a new Windows installer that downloads/extracts binaries, installs deps, and edits the user PATH via registry, plus refactors vp upgrade to 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 upgrade install plumbing into a new shared crate crates/vite_setup (platform detection, npm registry resolution, integrity checks, extraction, link/junction swap, cleanup), and updates vite_global_cli to use this library and surface vite_setup errors.

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.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 4, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 9bb496d
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69d8920890fe430009b95ae5

@fengmk2 fengmk2 self-assigned this Apr 4, 2026
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 4, 2026


How to use the Graphite Merge Queue

Add 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.

@fengmk2 fengmk2 force-pushed the windows-installer branch from 1b3a6a3 to 4dc36b5 Compare April 4, 2026 12:59
@fengmk2 fengmk2 force-pushed the windows-installer branch from 672909f to 816d7f1 Compare April 4, 2026 15:07
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 5, 2026

image.png

Double-click execution effect

@fengmk2 fengmk2 force-pushed the windows-installer branch from 4fe6fd3 to a87b42c Compare April 5, 2026 05:23
@fengmk2
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 5, 2026

Manual Testing Plan: vp-setup.exe Windows Installer

Prerequisites

  • Windows 10/11 machine (x64 or ARM64)
  • Build vp-setup.exe locally or download from the PR's CI artifacts
  • Clean state: no existing ~/.vite-plus directory (back up and remove if present)

1. Fresh Install — Double-Click

  • 1.1 Download vp-setup.exe to Downloads folder → Browser shows SmartScreen warning
  • 1.2 Click "..." → "Keep" → "Keep anyway" → File saved
  • 1.3 Double-click vp-setup.exe → Console window opens, interactive menu displayed
  • 1.4 Press Enter (default: Proceed) → Installation runs, success message shown
  • 1.5 Verify "Press Enter to close..." prompt → Window stays open until Enter pressed
  • 1.6 Open a new terminal, run vp --version → Version printed
  • 1.7 Run vp --help → Help output shown

2. Fresh Install — Shell Invocations

  • 2.1 Run from PowerShell: .\vp-setup.exe → Interactive menu shown
  • 2.2 Run from cmd.exe: vp-setup.exe → Interactive menu shown
  • 2.3 Run from Git Bash: ./vp-setup.exe → Interactive menu shown
  • 2.4 Run with -y: vp-setup.exe -y → No prompts, installs directly, exits without pause

3. Interactive Menu — Customize

  • 3.1 At main menu, press 2 (Customize) → Customize submenu shown with 4 options
  • 3.2 Press 1, type 0.1.14-alpha.1, Enter → Version changes to 0.1.14-alpha.1
  • 3.3 Press 3 to toggle Node.js manager → Toggles between "enabled" / "disabled"
  • 3.4 Press 4 to toggle Modify PATH → Toggles between "yes" / "no"
  • 3.5 Press Enter to go back → Main menu shows updated values
  • 3.6 Press 3 (Cancel) → "Installation cancelled." printed

4. Node.js Manager Auto-Detection

  • 4.1 System has Node.js installed, run interactively → Node.js manager defaults to "enabled"
  • 4.2 System has Node.js installed, run with -y → Node.js manager defaults to "disabled" (no shim takeover)
  • 4.3 Set VP_NODE_MANAGER=no, run → Node.js manager disabled regardless of mode
  • 4.4 Set VP_NODE_MANAGER=yes, run with -y → Node.js manager enabled even in silent mode

5. Same-Version Repair

  • 5.1 With vp already installed, run vp-setup.exe -y → Prints "already installed, verifying setup...", skips download
  • 5.2 Delete ~/.vite-plus/bin/vp.exe, run vp-setup.exe -y → Repairs: recreates bin shim, vp --version works after
  • 5.3 Remove ~/.vite-plus/bin from User PATH, run vp-setup.exe -y → Repairs: PATH re-added

6. Upgrade Path

  • 6.1 Install an older version: vp-setup.exe -y --version 0.1.14-alpha.1 → Installs specified version
  • 6.2 Run vp-setup.exe -y (no version flag) → Upgrades to latest, prints "upgrading from X to Y"
  • 6.3 Run vp upgrade --rollback → Rolls back to the previous version

7. Post-Installation Verification

  • 7.1 Check ~/.vite-plus/current → Junction points to installed version dir
  • 7.2 Check ~/.vite-plus/bin/vp.exe → Exists (trampoline shim)
  • 7.3 Check User PATH ($env:Path) → Contains ~/.vite-plus/bin
  • 7.4 Run vp env doctor → No errors
  • 7.5 Run vp create vite -- test-app --no-interactive -t vanilla → Project created successfully
  • 7.6 cd test-app && vp run build → Build succeeds

8. Environment Variables

  • 8.1 Set VP_VERSION=0.1.14-alpha.1, run vp-setup.exe -y → Installs specified version
  • 8.2 Set VP_HOME=C:\custom-dir, run vp-setup.exe -y → Installs to custom directory
  • 8.3 Set CI=true, run vp-setup.exe (no -y) → Runs non-interactively (no prompts)

9. Error Handling

  • 9.1 Run with --version nonexistent-version → Error message, exit code 1
  • 9.2 Run with no internet connection → Error message about network/registry
  • 9.3 Run with --no-modify-path → Installs successfully, PATH not modified

@fengmk2

This comment was marked as outdated.

chatgpt-codex-connector[bot]

This comment was marked as outdated.

@fengmk2 fengmk2 force-pushed the windows-installer branch from a8c95ab to aa5dfc2 Compare April 7, 2026 02:59

This comment was marked as outdated.

chatgpt-codex-connector[bot]

This comment was marked as outdated.

@fengmk2 fengmk2 force-pushed the windows-installer branch 2 times, most recently from e88ee5c to 29f821e Compare April 8, 2026 02:31
@fengmk2

This comment was marked as outdated.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@fengmk2 fengmk2 marked this pull request as ready for review April 8, 2026 05:40
@fengmk2 fengmk2 requested review from branchseer and cpojer April 8, 2026 05:40
@fengmk2 fengmk2 force-pushed the windows-installer branch from ba538e1 to 3376eb0 Compare April 8, 2026 16:11
@fengmk2
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 8, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

fengmk2 added a commit that referenced this pull request Apr 8, 2026
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
@fengmk2 fengmk2 force-pushed the windows-installer branch from 3376eb0 to 2e26da4 Compare April 8, 2026 16:24
@fengmk2
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 8, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 9, 2026

@cpojer When you have a time, please take a look at this new feature 😉

@fengmk2

This comment was marked as resolved.

cursor[bot]

This comment was marked as resolved.

@fengmk2
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 10, 2026

@cursor review

@fengmk2 fengmk2 force-pushed the windows-installer branch from d49974c to 1d5ca4a Compare April 10, 2026 03:10
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 10, 2026

@cursor review

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ 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);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1d5ca4a. Configure here.

install_dir: &AbsolutePathBuf,
target_version: &str,
resolved_version: &str,
has_previous: bool,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1d5ca4a. Configure here.

@cpojer cpojer requested a review from shulaoda April 10, 2026 04:02
@cpojer
Copy link
Copy Markdown
Member

cpojer commented Apr 10, 2026

@shulaoda I have not used Windows in a long time, would you be able to review (and approve) this PR?

fengmk2 added 4 commits April 10, 2026 14:00
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test: e2e Auto run e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants