Skip to content

Only offer elevation on access errors on Windows - #24395

Open
SPTApyo wants to merge 1 commit into
Nexus-Mods:masterfrom
SPTApyo:fix/linux-no-uac-prompt
Open

SPTApyo wants to merge 1 commit into
Nexus-Mods:masterfrom
SPTApyo:fix/linux-no-uac-prompt

Conversation

@SPTApyo

@SPTApyo SPTApyo commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

On Linux, an EACCES from forcePerm shows the "Access denied" dialog saying Windows will show a UAC prompt, with a "Give permission" button. Clicking it fails with ReferenceError: os is not defined, because permissions.getUserId() uses os without requiring it on non-Windows, and the elevation itself goes through ShellExecuteEx anyway.

Outside Windows the dialogs now only offer Cancel and Retry, without the UAC sentence, and ensureDirWritableAsync returns the original error instead of trying to elevate.

Reproduced in the app with forcePerm writing into a read-only directory, before and after. Added a test for the forcePerm dialog buttons.

@SPTApyo
SPTApyo requested a review from a team as a code owner October 4, 2026 01:44
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.

1 participant