Skip to content

Commit 2890b1a

Browse files
committed
fix(installer): install portable Node directory atomically
1 parent 937a756 commit 2890b1a

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Docs: https://docs.openclaw.ai
6161
- Plugins/discovery: strip `-plugin` package suffixes when deriving plugin id hints so package names line up with manifest ids. (#85170) Thanks @JulyanXu.
6262
- Telegram: preserve fenced code block languages through Markdown rendering so Telegram receives `language-*` code classes. (#85209) Thanks @leno23.
6363
- Windows installer: bootstrap a user-local portable Node.js when native Windows has no Node and no winget, Chocolatey, or Scoop, so first-run installs can continue on raw hosts.
64+
- Windows installer: install the downloaded portable Node.js directory atomically so PowerShell 5.1 first-run bootstraps do not fail while moving zip contents.
6465
- fix(integrations): enforce channel read target allowlists [AI]. (#84982) Thanks @pgondhi987.
6566
- Agents/heartbeat: route single-owner `session.dmScope=main` direct-message exec and cron event wakes back to the agent main session so async completions no longer strand context in orphan direct-DM queues. Fixes #71581. (#83743) Thanks @Kaspre.
6667
- Agents/code-mode: expose outer code-mode `exec` source through the `command` hook alias with `toolKind`/`toolInputKind` discriminators so exec-shaped policies can distinguish code-mode cells. (#83483) Thanks @Kaspre.

scripts/install.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,7 @@ function Install-PortableNode {
222222
throw "Node.js archive did not contain node.exe."
223223
}
224224

225-
New-Item -ItemType Directory -Force -Path $portableRoot | Out-Null
226-
Move-Item -Path (Join-Path $nodeDir.FullName "*") -Destination $portableRoot -Force
225+
Move-Item -LiteralPath $nodeDir.FullName -Destination $portableRoot -Force
227226
} finally {
228227
if (Test-Path $tmpZip) {
229228
Remove-Item -Force $tmpZip

test/scripts/install-ps1.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,14 @@ describe("install.ps1 failure handling", () => {
128128
expect(depsRootBody).toContain("OpenClaw\\deps");
129129
expect(portableNodeBody).toContain("portable-node");
130130
expect(portableNodeBody).toContain("Ensure-PortableNodeOnUserPath");
131+
expect(portableNodeBody).toContain(
132+
"Move-Item -LiteralPath $nodeDir.FullName -Destination $portableRoot -Force",
133+
);
134+
expect(portableNodeBody).not.toContain('Join-Path $nodeDir.FullName "*"');
131135
expect(portableNodePathBody).toContain("Add-ToUserPath $nodeDir");
132-
expect(userPathBody).toContain('[Environment]::SetEnvironmentVariable("Path", $newUserPath, "User")');
136+
expect(userPathBody).toContain(
137+
'[Environment]::SetEnvironmentVariable("Path", $newUserPath, "User")',
138+
);
133139
expect(portableNodeBody).toContain("Invoke-WebRequest -UseBasicParsing");
134140
expect(resolveNodeBody).toContain("https://nodejs.org/dist/index.json");
135141
expect(resolveNodeBody).toContain("win-$architecture-zip");

0 commit comments

Comments
 (0)