Skip to content

fix(windows): improve install.ps1 errors for missing VC++ runtime#1962

Open
cheezone wants to merge 2 commits into
voidzero-dev:mainfrom
cheezone:main
Open

fix(windows): improve install.ps1 errors for missing VC++ runtime#1962
cheezone wants to merge 2 commits into
voidzero-dev:mainfrom
cheezone:main

Conversation

@cheezone

Copy link
Copy Markdown

Summary

On clean Windows machines without the MSVC runtime, vp.exe fails to start during irm https://vite.plus/ps1 | iex with exit code 0xC0000135 (STATUS_DLL_NOT_FOUND). The installer previously reported a generic "Failed to install dependencies" with an empty install.log, and exit 1 closed the entire PowerShell window when run via iex.

This PR:

  • Detects 0xC0000135 after vp.exe install fails and prints VC++ 2015–2022 Redistributable install guidance (x64/arm64)
  • Replaces bare exit 1 with a non-CI halt path so interactive irm | iex installs keep the shell open without duplicating the error message

All Write-Error-Exit paths now keep the interactive shell open when not running under CI=true.

Context

Similar report elsewhere: kirodotdev/Kiro#9752

Test plan

  • Clean Windows without VC++: single clear error, shell stays open (no duplicate message, no window close)
  • Windows with VC++ installed: install completes normally
  • CI path (CI=true): still exits with non-zero code

@netlify

netlify Bot commented Jun 27, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 61c90a6
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a3f9de7d374d20008587a37

@fengmk2

fengmk2 commented Jun 27, 2026

Copy link
Copy Markdown
Member

@codex review

@ljlsasuke

Copy link
Copy Markdown

I’ve come across this problem too; it’s a great fix.

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

Copy link
Copy Markdown

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: 7ec73799b7

ℹ️ 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".

Comment thread packages/cli/install.ps1
Comment thread packages/cli/install.ps1 Outdated
Comment thread packages/cli/install.ps1
cheezone added 2 commits June 27, 2026 17:54
Detect STATUS_DLL_NOT_FOUND (0xC0000135) when vp.exe install fails on
clean Windows and print VC++ Redistributable guidance. Stop using exit in
interactive irm | iex installs so the PowerShell session stays open.
- Exit with non-zero code when invoked as a script file (not only CI=true)
- Compare NTSTATUS exit codes without unsafe UInt32 casts
- Rethrow install stop signal from nested metadata catch blocks
@cheezone

Copy link
Copy Markdown
Author

Thanks for the Codex review — addressed in the latest push:

  1. Non-CI exit code: Exit-Installer now calls exit $Code when $PSCommandPath is set (e.g. powershell -File install.ps1), not only when CI=true. The catchable stop signal is only used for irm | iex where there is no script file path.

  2. NTSTATUS comparison: Test-IsDllNotFoundExitCode no longer casts arbitrary negative exit codes to [uint32]; it compares the signed value and uses -band 0xFFFFFFFF for hex matching.

  3. Nested catch: Get-PackageMetadata inner catch blocks rethrow VP_INSTALL_STOP so registry/JSON fallback does not mask an already-printed error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants