Repository navigation
install.ps1: fix Windows PowerShell 5.1 Node check and non-elevated config lock - #10
Merged
Merged
Conversation
The probe node -p 'process.versions.node.split(".")[0]' loses its double quotes
in PowerShell 5.1, so every Node (including a fresh download) read as version 0
and the install failed with 'Node unpacked but does not run'. Use
parseInt(process.versions.node), and add a test that keeps probes free of
double quotes.
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.
Problems (both found running
install.ps1from Windows PowerShell 5.1)Find-Noderannode -p 'process.versions.node.split(".")[0]'. PowerShell 5.1 drops the double quotes inside native-command arguments, so node gotsplit(.)[0], threw a SyntaxError, and every Node read as major 0. Install failed withNode unpacked but does not run, even with Node 22 present. NowparseInt(process.versions.node).Set-ConfigAclusedGet-Acl/Set-Acl, which rewrites the whole security descriptor and throwsPrivilegeNotHeldException(SeSecurityPrivilege) in a normal, non-elevated shell, aborting at the config step. Nowicacls /inheritance:r /grant:r "<me>:(F)", which gives the same owner-only result.Regression tests for both (no double quotes in
node -pprobes;icacls.exeused, noSet-Acl).Verified
STEP node OKandSTEP app OKSTEP config OKRegister-ScheduledTask) needs a shell allowed to create scheduled tasks; not yet verified end to endThe 8 other
installer.test.tsfailures on Windows are the bash-driven tests that #9 skips on Windows.