fix(portable): node-extract path + unreachable legacy-config sync

Two real bugs in the portable launchers:

1. Windows-Install.bat: xcopy reads from %TEMP%\node-<ver>-win-x64
   but Expand-Archive extracts into %TEMP%\node-extract\node-<ver>-win-x64.
   Result: empty runtime\node-win-x64\ on networked install path.

2. Mac-Start.command + Windows-Start.bat: legacy-config sync block
   was placed AFTER the default-config block, so the "config.json
   exists but openclaw.json doesn't" branch was unreachable. Existing
   USB users with config.json never got their settings migrated;
   they got the empty default instead.

Reordered so legacy migration runs first, default only as fallback.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
hfshfg
2026-05-01 15:36:34 +08:00
parent 88cf2b2dc4
commit b6ba958b79
3 changed files with 20 additions and 18 deletions

View File

@@ -115,7 +115,7 @@ if "!USE_NODE!"=="usb" (
echo 解压中...
mkdir "%INSTALL_TARGET%\runtime\node-win-x64" 2>nul
powershell -command "Expand-Archive -Path '%TEMP%\!NODE_ZIP!' -DestinationPath '%TEMP%\node-extract' -Force"
xcopy /s /e /q /y "%TEMP%\node-%NODE_VER%-win-x64\*" "%INSTALL_TARGET%\runtime\node-win-x64\" >nul
xcopy /s /e /q /y "%TEMP%\node-extract\node-%NODE_VER%-win-x64\*" "%INSTALL_TARGET%\runtime\node-win-x64\" >nul
rmdir /s /q "%TEMP%\node-extract" 2>nul
del "%TEMP%\!NODE_ZIP!" 2>nul