Visitar URL original
install.ps1: fix Windows PowerShell 5.1 Node check and non-elevated config lock by SIDDHANTCOOKIE · Pull Request #10 · SIDDHANTCOOKIE/PocketBuff · GitHub
Skip to content

install.ps1: fix Windows PowerShell 5.1 Node check and non-elevated config lock - #10

Merged
SIDDHANTCOOKIE merged 1 commit into
mainfrom
fix/installer-ps51-node-check
Oct 19, 2026
Merged

SIDDHANTCOOKIE merged 1 commit into
mainfrom
fix/installer-ps51-node-check

Conversation

@SIDDHANTCOOKIE

@SIDDHANTCOOKIE SIDDHANTCOOKIE commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Problems (both found running install.ps1 from Windows PowerShell 5.1)

  1. Node check — Find-Node ran node -p 'process.versions.node.split(".")[0]'. PowerShell 5.1 drops the double quotes inside native-command arguments, so node got split(.)[0], threw a SyntaxError, and every Node read as major 0. Install failed with Node unpacked but does not run, even with Node 22 present. Now parseInt(process.versions.node).
  2. Config lock — Set-ConfigAcl used Get-Acl/Set-Acl, which rewrites the whole security descriptor and throws PrivilegeNotHeldException (SeSecurityPrivilege) in a normal, non-elevated shell, aborting at the config step. Now icacls /inheritance:r /grant:r "<me>:(F)", which gives the same owner-only result.

Regression tests for both (no double quotes in node -p probes; icacls.exe used, no Set-Acl).

Verified

The 8 other installer.test.ts failures on Windows are the bash-driven tests that #9 skips on Windows.

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.
@SIDDHANTCOOKIE
SIDDHANTCOOKIE merged commit 2fa9f65 into main Oct 19, 2026
@SIDDHANTCOOKIE SIDDHANTCOOKIE changed the title install.ps1: fix Node version check on Windows PowerShell 5.1 install.ps1: fix Windows PowerShell 5.1 Node check and non-elevated config lock Oct 19, 2026
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