Skip to content

Add UAC elevation to Edit Configuration and Restart Service shortcuts#7

Merged
hooyao merged 1 commit intomainfrom
fix/shortcut-elevation
Apr 11, 2026
Merged

Add UAC elevation to Edit Configuration and Restart Service shortcuts#7
hooyao merged 1 commit intomainfrom
fix/shortcut-elevation

Conversation

@hooyao
Copy link
Copy Markdown
Owner

@hooyao hooyao commented Apr 11, 2026

Summary

  • Both Start Menu shortcuts ("Edit Configuration" and "Restart Service") require admin privileges but were not configured to prompt UAC
  • appsettings.jsonc lives under Program Files — notepad can't save without elevation
  • sc.exe stop/start requires admin — cmd window shows "access denied"
  • Fix: set the RunAsAdministrator flag in the .lnk binary (MS-SHLLINK byte 21, bit 0x20) via AfterInstall callback in Inno Setup

Test plan

  • Compile installer with ISCC.exe setup/RamDrive.iss
  • Install and check Start Menu shortcuts: right-click → Properties → Advanced → "Run as administrator" is checked
  • Click "Edit Configuration" → UAC prompt → notepad opens and can save
  • Click "Restart Service" → UAC prompt → service restarts successfully

🤖 Generated with Claude Code

Both shortcuts require admin privileges (writing to Program Files,
controlling services via sc.exe). Set the RunAsAdministrator flag in
the .lnk binary (byte 21, bit 0x20) so Windows prompts UAC on click.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hooyao hooyao merged commit cdef34d into main Apr 11, 2026
2 checks passed
@hooyao hooyao deleted the fix/shortcut-elevation branch April 11, 2026 12:10
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