[PR #7942] [MERGED] fix(installer): preserve PowerShell prerequisite command quoting #8014

Closed
opened 2026-10-24 04:09:40 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7942
Author: @SpicyMarinara
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/7933-windows-node-download-quote


📝 Commits (5)

  • 0d32b68 chore: start Windows installer quoting fix for #7933
  • 805c764 fix(installer): preserve PowerShell prerequisite command quoting
  • 4535805 test(installer): show prerequisite argument mismatch diagnostics
  • 3e12441 test(installer): canonicalize the Windows temporary fixture path
  • 1ff2baa fix(installer): share prerequisite paths and exercise NSIS commands

📊 Changes

3 files changed (+186 additions, -12 deletions)

View changed files

📝 .github/workflows/platform-artifacts.yml (+3 -0)
📝 scripts/check-windows-installer-layout.mjs (+159 -1)
📝 win/installer/installer.nsi (+24 -11)

📄 Description

Linked issue

Closes #7933

Why this change

A fresh Windows installation with Node.js 22 reaches the automatic Node.js upgrade and stops with The string is missing the terminator: ". The inline PowerShell command passes nested double quotes through both NSIS and cmd.exe; the same fragile quoting affects Git downloads and installer verification.

What changed

  • Invoke the four prerequisite PowerShell commands directly, keeping each script in one quoted argument and using single-quoted literals.
  • Resolve each prerequisite file once from NSIS $TEMP. Pass that path to PowerShell through an environment variable, and reuse the same NSIS variable for execution and cleanup. Environment publication failure aborts. Paths containing spaces, apostrophes or shell punctuation remain data.
  • Extend the existing guard with a compiled Windows NSIS harness that runs the actual nsExec::ExecToLog command lines and path-publication helper. A short preamble loads external HTTP/hash/signature stubs; positive download/verification and rejected hash/signature controls remain in place. The harness gives PowerShell a different inherited temporary directory after NSIS resolves $TEMP, covering the fallback mismatch.
  • Install NSIS in the native Windows platform job so the harness is compiled and executed there. Other hosts retain explicitly labeled PowerShell-only checks.

Validation

Current source revision: 1ff2baa4a6f50fdea1575b587191d8445ea3c5b4.

  • pnpm install and full pnpm check passed on the follow-up (existing hook/build warnings; no errors).
  • Full pnpm regression:launcher-update passed with official PowerShell 7.6.7 for macOS arm64, including URI/path/switch assertions, special path characters, differing inherited temporary paths and hash/signature failure controls.
  • The updated guard rejects the previous 3e1244187 GetTempPath implementation with the expected download-path identity mismatch. It also rejects the original nested command form.
  • The complete production installer and generated NSIS harness compile locally using a compiler built from NSIS v3.11 source and the existing v3.11 Windows stubs. This is compilation proof; no Windows executable ran locally.
  • pnpm version:check, focused Prettier and git diff --check passed.
  • Local CodeRabbit completed the three-file follow-up with zero findings. Independent read-only review found no substantive issue in the resolved-path contract, NSIS escaping, compiled harness or failure controls.
  • Both hosted outside-diff findings on 3e1244187 were accepted: the earlier direct PowerShell check omitted NSIS/nsExec argument expansion, and NSIS can fall back to Windows Temp without updating inherited TEMP/TMP. The compiled harness and one resolved path address those findings.
  • Exact-head Windows native install/build passed. Its log explicitly confirms the compiled NSIS/nsExec prerequisite commands passed positive and integrity-failure controls with differing inherited temp paths at 11:06:02 UTC.
  • Exact-head production NSIS compilation passed. Other required checks and substantive hosted CodeRabbit for this head still gate merge; previous-head evidence is superseded.

Human verification remains unchecked:

  • Manually verify the compiled installer on Windows 11 with Node.js 22 installed.
  • Manually verify a fresh Windows installation with Git absent.
  • Manually verify download failure still offers manual installation and invalid installer verification stops installation.

Manual verification notes

No interactive Windows installation was performed. Network downloads, MSI/Git execution and UAC prompts are outside the stubbed command proof. The Windows harness executes the compiled NSIS/nsExec prerequisite download/verification boundary only; compilation alone is not reported as runtime success.

Docs and release impact

The existing installation instructions already describe automatic prerequisite installation, which this fix restores. Reviewed README, Android README, CONTRIBUTING, configuration, troubleshooting, FAQ and Windows installation guidance; no user-facing instructions change. No version bump or CHANGELOG edit.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7942 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/7933-windows-node-download-quote` --- ### 📝 Commits (5) - [`0d32b68`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0d32b68677dd63a0621c782207427066edb31b30) chore: start Windows installer quoting fix for #7933 - [`805c764`](https://github.com/Pasta-Devs/Marinara-Engine/commit/805c764ca5b2daa47660565130de448c9cda811b) fix(installer): preserve PowerShell prerequisite command quoting - [`4535805`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4535805c16e5e8e3230682b0e8e0ca7c7c0cfdd8) test(installer): show prerequisite argument mismatch diagnostics - [`3e12441`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3e12441879be39ac7b850ffdbf08c6924f56c621) test(installer): canonicalize the Windows temporary fixture path - [`1ff2baa`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1ff2baa4a6f50fdea1575b587191d8445ea3c5b4) fix(installer): share prerequisite paths and exercise NSIS commands ### 📊 Changes **3 files changed** (+186 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/platform-artifacts.yml` (+3 -0) 📝 `scripts/check-windows-installer-layout.mjs` (+159 -1) 📝 `win/installer/installer.nsi` (+24 -11) </details> ### 📄 Description ## Linked issue Closes #7933 ## Why this change A fresh Windows installation with Node.js 22 reaches the automatic Node.js upgrade and stops with `The string is missing the terminator: "`. The inline PowerShell command passes nested double quotes through both NSIS and `cmd.exe`; the same fragile quoting affects Git downloads and installer verification. ## What changed - Invoke the four prerequisite PowerShell commands directly, keeping each script in one quoted argument and using single-quoted literals. - Resolve each prerequisite file once from NSIS `$TEMP`. Pass that path to PowerShell through an environment variable, and reuse the same NSIS variable for execution and cleanup. Environment publication failure aborts. Paths containing spaces, apostrophes or shell punctuation remain data. - Extend the existing guard with a compiled Windows NSIS harness that runs the actual `nsExec::ExecToLog` command lines and path-publication helper. A short preamble loads external HTTP/hash/signature stubs; positive download/verification and rejected hash/signature controls remain in place. The harness gives PowerShell a different inherited temporary directory after NSIS resolves `$TEMP`, covering the fallback mismatch. - Install NSIS in the native Windows platform job so the harness is compiled and executed there. Other hosts retain explicitly labeled PowerShell-only checks. ## Validation Current source revision: `1ff2baa4a6f50fdea1575b587191d8445ea3c5b4`. - `pnpm install` and full `pnpm check` passed on the follow-up (existing hook/build warnings; no errors). - Full `pnpm regression:launcher-update` passed with official PowerShell 7.6.7 for macOS arm64, including URI/path/switch assertions, special path characters, differing inherited temporary paths and hash/signature failure controls. - The updated guard rejects the previous `3e1244187` GetTempPath implementation with the expected download-path identity mismatch. It also rejects the original nested command form. - The complete production installer and generated NSIS harness compile locally using a compiler built from NSIS v3.11 source and the existing v3.11 Windows stubs. This is compilation proof; no Windows executable ran locally. - `pnpm version:check`, focused Prettier and `git diff --check` passed. - Local CodeRabbit completed the three-file follow-up with zero findings. Independent read-only review found no substantive issue in the resolved-path contract, NSIS escaping, compiled harness or failure controls. - Both hosted outside-diff findings on `3e1244187` were accepted: the earlier direct PowerShell check omitted NSIS/nsExec argument expansion, and NSIS can fall back to Windows Temp without updating inherited TEMP/TMP. The compiled harness and one resolved path address those findings. - Exact-head [Windows native install/build](https://github.com/Pasta-Devs/Marinara-Engine/actions/runs/39588861005/job/119184471521) passed. Its log explicitly confirms the compiled NSIS/nsExec prerequisite commands passed positive and integrity-failure controls with differing inherited temp paths at 11:06:02 UTC. - Exact-head [production NSIS compilation](https://github.com/Pasta-Devs/Marinara-Engine/actions/runs/39588861005/job/119184471863) passed. Other required checks and substantive hosted CodeRabbit for this head still gate merge; previous-head evidence is superseded. Human verification remains unchecked: - [ ] Manually verify the compiled installer on Windows 11 with Node.js 22 installed. - [ ] Manually verify a fresh Windows installation with Git absent. - [ ] Manually verify download failure still offers manual installation and invalid installer verification stops installation. ### Manual verification notes No interactive Windows installation was performed. Network downloads, MSI/Git execution and UAC prompts are outside the stubbed command proof. The Windows harness executes the compiled NSIS/nsExec prerequisite download/verification boundary only; compilation alone is not reported as runtime success. ## Docs and release impact The existing installation instructions already describe automatic prerequisite installation, which this fix restores. Reviewed README, Android README, CONTRIBUTING, configuration, troubleshooting, FAQ and Windows installation guidance; no user-facing instructions change. No version bump or CHANGELOG edit. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:09:40 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8014
No description provided.