Repository navigation
feat: elevate only the link step instead of restarting as admin - #41
Merged
Merged
Conversation
When a symbolic link needs administrator rights (no admin, no Developer Mode), Symlinker used to offer to restart the whole app elevated. That meant a restart, a UAC prompt, and a new window without drag and drop. Now the window stays unelevated. Create link starts a hidden copy of Symlinker.exe (--link-helper) with runas, which shows one UAC prompt and creates the link over a named pipe. It is started before anything on disk changes (deleting an existing item or the move-and-link flow), so declining the prompt quietly stops and leaves everything as it was. - LinkCommand runs mklink for both the window and the helper, and rejects paths with quotes or line breaks. - Both pipe ends verify the other's process ID. - Remove the restart dialog, the footer restart link and their strings. - Footer notice now says Windows will ask for permission. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every Create link started and closed its own elevated helper, so each symbolic link showed a new UAC prompt. The helper now stays up until the window closes, so the user approves once per session. If it was ended, the next symbolic link starts a new one. - Hide the UAC shield and the footer notice while the helper runs. - Only symbolic links that need admin go through the helper; junctions and hard links stay unelevated. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
amd989
added a commit
that referenced
this pull request
Nov 7, 2026
Now that only the link step elevates (#41), the Store build no longer needs requireAdministrator. The window starts unelevated, so drag and drop works, and the hidden link helper shows the UAC prompt through the allowElevation capability. - Remove Properties/app.msix.manifest and the MsixBuild switch - build-msix.ps1 now fails if the exe asks for admin at launch - Update CLAUDE.md and the privacy policy Tested with a signed copy of the package and Developer Mode off: the window ran unelevated, Create link showed one UAC prompt, and the symbolic link landed in the real %LOCALAPPDATA% folder. Co-Authored-By: Claude Opus 5.5 <[email protected]>
amd989
added a commit
that referenced
this pull request
Nov 7, 2026
* feat: 📦 add Microsoft Store (MSIX) package build-msix.ps1 builds a self-contained x64 + arm64 .msixbundle for Partner Center, which signs it. The release workflow uploads it as an artifact. The Store build uses its own app manifest that asks for admin at start, since a packaged app cannot relaunch itself with runas. The package turns off AppData write virtualization so links land where users point. Program.cs skips the relaunch when already elevated. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs: 📝 expand the privacy policy Cover admin rights, update checks per edition, and link the web version for the Microsoft Store listing. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat: ✨ check and test the Store package in build-msix.ps1 Mirror the Readout Store script: verify each package's version, architecture, capabilities and the exe's requireAdministrator manifest, print where to upload the bundle, and add -Install (register the unpacked package) and -Wack (test-sign, install and run the certification kit). An earlier test copy is removed first so rebuilds don't break it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix: 🐛 detect host architecture in Windows PowerShell 5.1 RuntimeInformation.OSArchitecture is missing in 5.1; read the native architecture from the registry instead. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix: 🐛 use the reserved Store name as the package display name Partner Center rejects packages whose Properties/DisplayName is not a reserved name, and "Symlinker" alone is taken. The Start menu name stays "Symlinker". Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat: ✨ keep the Store listing and screenshot tool in the repo - listings.json holds the listing text for all 9 package languages - ScreenshotTool renders the real main window in each language at 2.5x under a headline on a 1920x1080 image - make-listings.ps1 builds the screenshots and fills the exported Partner Center template (with and without screenshots) - README covers the import steps, Partner Center rules, the restricted capability text and the certification notes Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat: ✨ start the Store build unelevated Now that only the link step elevates (#41), the Store build no longer needs requireAdministrator. The window starts unelevated, so drag and drop works, and the hidden link helper shows the UAC prompt through the allowElevation capability. - Remove Properties/app.msix.manifest and the MsixBuild switch - build-msix.ps1 now fails if the exe asks for admin at launch - Update CLAUDE.md and the privacy policy Tested with a signed copy of the package and Developer Mode off: the window ran unelevated, Create link showed one UAC prompt, and the symbolic link landed in the real %LOCALAPPDATA% folder. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a symbolic link needs administrator rights (not elevated and Developer Mode off), Symlinker no longer restarts the whole app as administrator. The window stays unelevated and only link creation runs elevated, with a single UAC prompt per session and no restart. The form keeps its values and drag and drop keeps working.
How it works
Symlinker.exe --link-helper <pipe> <pid>is a hidden mode (no window) handled inProgram.cs.ElevateIfNeededAsync()starts that helper withrunasand waits for it to connect back over a named pipe. The window then sends link requests (LinkRequestas JSON) and the helper runs mklink and replies with the result, which is shown in the same dialog as before.GetNamedPipeClientProcessId/GetNamedPipeServerProcessId), the pipe allows a single instance, andLinkCommandrejects unknown link types and paths with quotes or line breaks. The helper can only ever run onemklinkper request.Other changes
LinkCommand.cs: mklink runner shared by the window and the helper (moved out ofRunMklinkAsync).Elevation.RestartElevated(),LaunchOptions.ToArguments()and the stringsButtonRestartAsAdmin,ButtonNotNow,DialogElevation,DialogElevationTitle.ElevationHelperFailedfor when the helper can't be reached.Resources.resx, all 8 translations andResources.Designer.cs.CLAUDE.md: updated components, link flow and the Administrator rights section.--mode,--type,--location,--name,--target) still work.Testing
dotnet build Symlinker/Symlinker.csproj -c Release: 0 errors. The only warning is the existing CS1591 inApp.xaml.cs." & echo pwnedrejected; an existing link reports mklink's error; the helper exits 0 when the pipe closes and exits 3 without reading anything when the parent PID doesn't match.runas: folder symlink, file symlink and move-and-link all went through the helper (one helper process during the step, none after), and a junction did not use the helper.Follow-up
CreateSymbolicLinkin the unelevated window, so that copy fails without Developer Mode (and rolls back). This existed before this PR.🤖 Generated with Claude Code