Skip to content

Fix NVM and VS Code uninstall failures by retaining elevation - #135

Open
AmirMS (AmelBawa-msft) wants to merge 1 commit into
mainfrom
user/amelbawa/fix-uninstall-elevation
Open

AmirMS (AmelBawa-msft) wants to merge 1 commit into
mainfrom
user/amelbawa/fix-uninstall-elevation

Conversation

@AmelBawa-msft

Copy link
Copy Markdown
Collaborator

No description provided.

@ranm-msft ranm-msft 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.

Reviewed the full diff. Dropping -Unelevated from Remove-DevConfigNvm and from Invoke-DevConfigInnoCleanup is correct: those uninstallers write to machine-scoped locations and to HKLM, so the temporary unelevated task was the thing making them fail. Keeping user-scope WinGet removals on the unelevated path preserves the behaviour that actually needs a user token, so the change is narrowly scoped rather than a blanket elevation.

One thing I deliberately checked: running the Inno uninstaller elevated does not strand per-user state, because the elevated cleanup process runs as the same user, so HKCU and the user profile resolve to the same hive and paths. No orphaned per-user leftovers.

src/tests/calm-os/uninstall-checks.ps1 is a solid harness. Shadowing Test-Path / Get-ChildItem / Get-ItemProperty / Get-AppxPackage / Invoke-DevConfigCleanupCommand keeps it hermetic, and asserting elevation routing, preserved silent args, machine-vs-user scope, the -CheckOnly no-op, the ignored unrelated publisher, and the rejected UninstallString with extra args covers the paths that matter.

No findings. Approving.

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.

2 participants