Skip to content

fix(install): show uv output on Windows install failure and use correct Defender cmdlet - #149

Merged
Jason Robert (jrob5756) merged 1 commit into
mainfrom
fix/install-script-windows-errors
May 5, 2026
Merged

fix(install): show uv output on Windows install failure and use correct Defender cmdlet#149
Jason Robert (jrob5756) merged 1 commit into
mainfrom
fix/install-script-windows-errors

Conversation

@jrob5756

Copy link
Copy Markdown
Collaborator

Summary

Two bugs in install.ps1 that combine to make Windows install failures essentially undebuggable:

1. uv tool install output was swallowed

The script captured each retry's combined stdout/stderr into $output and then discarded it. On failure, users saw only a generic 'this is often caused by Windows Defender' guess with no way to confirm or refute it.

2. Suggested mitigation cmdlet doesn't exist

The error path recommended Add-MpExclusion -Path ... — that cmdlet does not exist in any version of PowerShell. Users who tried to follow the advice hit The term 'Add-MpExclusion' is not recognized. The real cmdlet is Add-MpPreference -ExclusionPath ..., which additionally requires running PowerShell as Administrator on most Windows configurations.

Changes

  • Capture the last attempt's combined stdout/stderr into $lastOutput and print it under a labeled header before the failure summary, so users can see what uv actually said.
  • Replace Add-MpExclusion with the correct Add-MpPreference -ExclusionPath form, noting the admin requirement.
  • Reframe the Defender messaging as conditional on the actual error text ("if the output above mentions a locked file or 'access is denied'") rather than unconditional speculation.

Out of scope

This PR does not try to detect or auto-resolve the underlying constrained-install failure that produced the bug report. With this fix, users (and the maintainers) can now see what uv printed and triage from there. A follow-up could add a constrained → unconstrained fallback with a warning, but that risks silently producing subtly broken installs and was deferred.

Verification

  • Successful-install path: unchanged (no behavior change in the success branch).
  • Failure path (manual sanity check by reading the diff): $lastOutput is captured and printed; cmdlet name is correct.
  • No backend code touched, no test impact.

The Windows installer caught uv tool install output into a variable but
never displayed it on failure. Users saw a generic 'this is often caused
by Windows Defender' guess with no way to confirm or refute. Worse, the
suggested mitigation referenced a non-existent cmdlet (Add-MpExclusion);
the real cmdlet is Add-MpPreference -ExclusionPath, which on most
configurations also requires running PowerShell as Administrator.
Changes:
- Capture the last attempt's combined stdout/stderr in $lastOutput and
print it under a labeled header before the failure summary.
- Replace the bogus Add-MpExclusion suggestion with the correct
Add-MpPreference -ExclusionPath form, with a note about the admin
requirement.
- Reframe the Defender messaging as conditional on the actual error
text rather than an unconditional speculation.
This does not change any successful-install behavior; it only improves
the diagnostic surface when uv tool install fails three times.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jrob5756
Jason Robert (jrob5756) merged commit 61458b8 into mainMay 5, 2026
6 checks passed
@jrob5756
Jason Robert (jrob5756) deleted the fix/install-script-windows-errors branch May 5, 2026 01:47
Jason Robert (jrob5756) added a commit that referenced this pull request May 6, 2026
* chore: release 0.1.12
Bumps version to 0.1.12 and updates CHANGELOG with the four PRs
merged since v0.1.11:
- #149: Windows install diagnostics
- #151: Tag-based registry versioning with # ref syntax
- #152: Unified reasoning.effort configuration
- #153: Dashboard layout fix for human_gate options + loop-backs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chore: add #155 (Windows update reliability) to 0.1.12 changelog
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for freeto 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.

1 participant

@jrob5756