Skip to content

Fix Scoop shim failure under RedirectionGuard by retrying elevated#4899

Merged
Gabriel Dufresne (GabrielDuf) merged 2 commits into
mainfrom
notepad-scoop-issue
Jun 8, 2026
Merged

Fix Scoop shim failure under RedirectionGuard by retrying elevated#4899
Gabriel Dufresne (GabrielDuf) merged 2 commits into
mainfrom
notepad-scoop-issue

Conversation

@GabrielDuf

Copy link
Copy Markdown
Contributor

This pull request improves how the Scoop package manager handles shim creation failures that require elevation, and adds tests to ensure this behavior works as expected. The main change is to automatically retry failed shim operations with elevated privileges if a specific error is detected, preventing unnecessary failures and improving reliability.

Scoop shim error handling:

  • Updated ScoopPkgOperationHelper.cs to detect shim resolution failures (messages containing "Can't shim") and automatically retry the operation with elevated privileges, unless already running as administrator. This prevents failures caused by permission issues when creating shims.

Test coverage improvements:

  • Added unit tests in ScoopManagerTests.cs to verify:
    • The operation is retried with elevation on shim resolution failure, and does not loop if already elevated.
    • The presence of a "Can't shim" message does not trigger a retry if the operation succeeded.

@GabrielDuf Gabriel Dufresne (GabrielDuf) merged commit ff20c00 into main Jun 8, 2026
11 of 12 checks passed
@GabrielDuf Gabriel Dufresne (GabrielDuf) deleted the notepad-scoop-issue branch June 8, 2026 21:00
@GabrielDuf Gabriel Dufresne (GabrielDuf) linked an issue Jun 8, 2026 that may be closed by this pull request
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Error on update / install of Notepad++ from Scoop

2 participants