Skip to content

Deploy openXYOS at install time into LocalAppData and verify livez - #29

Merged
XYAIStudio merged 2 commits into
mainfrom
cursor/install-time-openxyos-af8c
Sep 16, 2026
Merged

XYAIStudio merged 2 commits into
mainfrom
cursor/install-time-openxyos-af8c

Conversation

@XYAIStudio

@XYAIStudio XYAIStudio commented Sep 16, 2026 •

Copy link
Copy Markdown
Owner

Why this PR

用户明确拒绝「安装只解到 Program Files → 首次打开 FreeOS 再拷到本机 → 再启 FE/BE」。组织页打开应该是 embed/connect,不是再做一次部署。

默认安装目录是 C:\Program Files\FreeOS。未提权的 FreeOS.exe 写不进去,所以真正的可写本机根必须是 %LOCALAPPDATA%\FreeOS\openxyos。这次把 写入这个目录的工作提前到 elevated Setup,用安装用户的 LOCALAPPDATA 环境变量(不能用 SetShellVarContext all 之后的 NSIS $LOCALAPPDATA,那是 ProgramData)。

截图里的 Expand-Archive -LiteralPath 缺参是旧安装包;本 PR 仍只用 tar.exe + 安装期展开的 .cmd(路径在写入时已展开,带空格的 Program Files 安全)。

不要合并 Release / 不要替换 GitHub Release 资产。 协调员打包装船。

CI follow-up

makensis 曾报 FileWrite expects 2 parameters, got 3:`...(`$\r$\n` 里 ( 后的反引号提前结束字符串。已改为 goto、去掉 probe 脚本里的逗号,并加了 FileWrite 参数个数契约测试。

安装期行为

  1. CI 预构建 openxyos-runtime.zip(node/node.exe + openxyos/dist/index.html + openxyos/backend/server.ts)。用户机器不跑 npm。
  2. NSIS 用 tar.exe 解到:
    • 本机根(必须完整) %LOCALAPPDATA%\FreeOS\openxyos
    • 备份 $INSTDIR\openxyos 与 $INSTDIR\openxyos-runtime
  3. 缺 node.exe / dist/index.html → Abort 67,不会留下只有 README 的树。
  4. Setup 拉起本机 FE+BE,探测 http://127.0.0.1:3780/api/health/livez(最多约 60s)。探测用 $PLUGINSDIR 临时 sqlite,不写 ~/.freeos(避免 High integrity)。通过后结束探测进程。失败 → Abort 68。
  5. 写入 .install-ready。icacls 给当前用户对本机 FreeOS 目录的修改权,方便未提权进程冷启动。

首次打开 FreeOS

  • 本机根已完整 → 跳过拷贝/解压,只 spawn 已在盘上的 Node。
  • 拷贝只保留为愈合路径(其他 Windows 用户、或 Setup 从未写过本机根的旧包)。
  • 组织页健康时自动 embed http://127.0.0.1:3780,不必再点「启动边车」。

Windows 验证(装完后)

用 本 PR 打出来的新 NSIS,不要用仍带 Expand-Archive 的旧包。

  1. 安装日志应出现:解压到 %LOCALAPPDATA%\FreeOS\openxyos、node.exe / dist\\index.html 就绪、livez 通过。不应再出现 Expand-Archive / LiteralPath。
  2. 确认存在:
    • %LOCALAPPDATA%\\FreeOS\\openxyos\\node\\node.exe
    • %LOCALAPPDATA%\\FreeOS\\openxyos\\openxyos\\dist\\index.html
    • %LOCALAPPDATA%\\FreeOS\\openxyos\\.install-ready
  3. 打开 FreeOS 后:http://127.0.0.1:3780/api/health/livez 为 200。
  4. 打开 组织:右侧预览应嵌入控制台,无需先点「启动边车」。
Open in Web Open in Cursor 

The elevated installer now extracts the prebuilt runtime with tar.exe
directly into %LOCALAPPDATA%\FreeOS\openxyos (the writable live root),
keeps Program Files trees as backups, and probes
http://127.0.0.1:3780/api/health/livez before Setup finishes. First
FreeOS start skips copy/unpack when that tree is already complete.

Co-authored-by: XYAI Labs <haoboy8@gmail.com>
@XYAIStudio
XYAIStudio marked this pull request as ready for review September 16, 2026 06:31
A backtick immediately after '(' closed the FileWrite string and left
$\r$\n as a third argument. Use cmd goto instead of parentheses, drop
commas from the livez probe script, and assert every FileWrite has
exactly two parameters.

Co-authored-by: XYAI Labs <haoboy8@gmail.com>
@XYAIStudio
XYAIStudio merged commit 6e5e5d0 into main Sep 16, 2026
12 checks passed
@XYAIStudio
XYAIStudio deleted the cursor/install-time-openxyos-af8c branch September 16, 2026 07:28
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.

2 participants