Repository navigation
Conversation
This branch has not been deployed
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.
What
createSymlink()recreates unpacked links without telling Windows what the link points at:On Windows an untyped
symlinkis created as a file link, so a packaged symlink to adirectory becomes a link that can never be entered as a directory — and creating a directory
symlink at all requires Developer Mode or elevation, so on a normal account unpacking aborts with
The change
filesystem.getFile(...)), because thetarget does not have to be unpacked itself;
fs.symlink;EPERM, fall back to a junction, the only directorylink an unprivileged Windows user can create;
.unpackedrather than back at the packaged source.One test is added: pack a directory symlink with
--unpack, extract, and assert that the extractedentry is a symlink whose
statis a directory, whose payload reads back, and whoserealpathstaysinside
.unpacked.Verification
Windows 11, non-elevated, Developer Mode off:
extractAll()and the CLI(
asar p app app.asar --unpack "*");.unpacked/varis a symbolic link,statsays directory,file.txtinside it reads back,and
realpathis inside.unpacked.Full suite: 196 passed / 7 failed before, 197 passed / 6 failed after — the only difference is the
new test, and the remaining 6 failures are identical on the unmodified tree.
oxfmt --checkandoxlintare clean.The elevated
type: 'dir'branch is not exercised on this machine (non-elevated), so the junctionfallback is what the test covers; file symlinks still need elevation and are out of scope here.