Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/octop-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ jobs:
echo "org-sidecar missing under ${staging}" >&2
exit 1
fi
if [[ ! -f "${staging}/org-sidecar/openxyos/dist/index.html" ]]; then
echo "openXYOS frontend missing under ${staging}/org-sidecar/openxyos/dist" >&2
exit 1
fi
if [[ -f "${staging}/org-sidecar/node/node.exe" || -x "${staging}/org-sidecar/node/bin/node" ]]; then
echo "org-sidecar Node runtime present"
else
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

- 组织循环时间线的是/否改为中英文本地化,不再混用 `true`/`false`。
- 边车启动会写入并传递 `FREEOS_INGEST_TOKEN`;Python 启动器同时识别 `%LOCALAPPDATA%\FreeOS\openxyos`、`$INSTDIR\openxyos` 与 portable `org-sidecar`。
- Windows 安装包写入预构建 openXYOS 运行包(`$INSTDIR\openxyos` + `openxyos-runtime.zip`),首次启动再落到 `%LOCALAPPDATA%\FreeOS\openxyos` / `~/.freeos/openxyos`,自动拉起 `http://127.0.0.1:3780`,组织页不必再点「启动边车」。
- Windows 安装包在 Setup 内把预构建 openXYOS 运行包解到 `%LOCALAPPDATA%\FreeOS\openxyos`(可写本机根)并完成 livez 探测;`$INSTDIR\openxyos` 仅作备份。组织页打开即可嵌入 `http://127.0.0.1:3780`,不必再点「启动边车」,也不再等首次启动拷贝。
- 项目创建用系统文件夹选择器(Wails 原生对话框,任意盘符);项目/任务/对话区默认展示实时对话列表,并提供建群/群聊入口。
- Organization OS 首页双循环:FreeOS 数据面与 openXYOS 控制面的实时状态、一键导入部门员工为同事 / 打包专家为员工 / 运行 org loop,以及边车离线时的启动恢复。
- FreeOS 官网源码:`website/`(Vite + React 静态站,正式域名 https://freeos.cnxy.tech)。视觉与章节节奏对齐 XYAI Labs(天蓝→亮光、毛玻璃、01/02/…、底座 / 系统 / 生态),文案仍是 FreeOS 产品自己的话;圆形标志 + XYAI 机器人六姿态,无 Octop 红或章鱼形象。构建产物可整包上传到 `/www/wwwroot/freeos.cnxy.tech`。
Expand All @@ -36,7 +36,7 @@

### 修复

- Windows 安装把预构建 openXYOS 运行包用 `tar.exe` 解到 `$INSTDIR\openxyos` 与 `$INSTDIR\openxyos-runtime`(带空格的 `Program Files` 也能解全)。缺少 `node\node.exe` 或 `dist\index.html` 时安装失败,不再留下只有 README 的工作目录。首次启动会从完整树复制到 `%LOCALAPPDATA%\FreeOS\openxyos` 并自动拉起边车。组织页「下载最新 openXYOS 源码」走系统文件夹选择器(任意盘符),不再只用手输路径。
- Windows 安装期就把预构建 openXYOS 用 `tar.exe` 解到 **`%LOCALAPPDATA%\FreeOS\openxyos` 本机工作目录**(`Program Files` 只作只读备份:`$INSTDIR\openxyos` 与 `openxyos-runtime`)。Setup 会拉起 FE+BE 直到 `http://127.0.0.1:3780/api/health/livez` 通过再结束;缺少 `node\node.exe` / `dist\index.html` 或健康检查失败则安装失败。首次打开 FreeOS 不再从安装目录拷贝/解压。组织页「下载最新 openXYOS 源码」走系统文件夹选择器(任意盘符),不再只用手输路径。
- 桌面 / 本地会话不再被 `setup_required` 短路:`GET /setup/status` 之后仍可调用 `POST /auth/local-session`,不会误跳进服务端密码向导。
- 组织页「启动边车」会拉起捆绑的 Node + openXYOS(Windows 用 `node.exe` / `cmd /c`,不再直接 Popen `.bat`),并在右侧预览区嵌入控制台(支持全屏)。openXYOS 在 FreeOS 桌面环境下关闭 `X-Frame-Options`,避免 iframe 空白。安装 / 桌面启动时宿主与 Wails 都会确保边车常开(需 `dist/index.html` 已打包)。
- Windows 打开时不再因 WebView2 `Navigate`/`SetURL` 在 Chromium 未就绪时触发 Go panic。主窗口等 WebView 点火后再跳转;`SetURL` 失败会重试并显示 FreeOS 提示,而不是原始堆栈。设置窗口延后创建,避免两个 WebView2 同时初始化同一用户目录。用户数据目录必须可写,并设置 `WEBVIEW2_USER_DATA_FOLDER`。
Expand Down
45 changes: 27 additions & 18 deletions desktop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ Same precedence as the FreeOS CLI/server:
- Organization sidecar data → `{home}/org-os/`
- Local openXYOS workdir (FE+BE) → `%LOCALAPPDATA%\FreeOS\openxyos` on Windows,
else `{home}/openxyos`. The NSIS installer expands a prebuilt
`openxyos-runtime.zip` into `$INSTDIR\openxyos` and `$INSTDIR\openxyos-runtime`
(install fails if `node` or `dist` is missing). First unelevated start copies
that tree into the workdir and starts `http://127.0.0.1:3780`.
`openxyos-runtime.zip` **directly into that live workdir** during Setup
(and keeps `$INSTDIR\openxyos` / `$INSTDIR\openxyos-runtime` as backups).
Install fails if `node` or `dist` is missing, or if
`http://127.0.0.1:3780/api/health/livez` does not pass before Setup exits.
First FreeOS start only spawns the already-on-disk sidecar — no copy/unpack.
- Shell prefs → `{home}/desktop-settings.json`

## Windows install finish
Expand All @@ -41,16 +43,21 @@ with `makensis -INPUTCHARSET UTF8` from a UTF-8 BOM `project.nsi`.
The install log is no longer only `FreeOS.exe` + shortcuts. A healthy package
also copies `openxyos-runtime.zip` (prebuilt Node + openXYOS frontend/backend)
and extracts it with Windows `tar.exe` (quoted paths, so `Program Files`
works) into **both** `$INSTDIR\openxyos` and `$INSTDIR\openxyos-runtime`.
Setup **aborts** if `node\node.exe` or `dist\index.html` is missing after
extract — a README-only `$INSTDIR\openxyos` is not a successful install.
The durable workdir is `%LOCALAPPDATA%\FreeOS\openxyos` (and `{home}/openxyos`).
Program Files is read-only, so first start — not the elevated installer —
copies the complete tree into the user workdir (and will heal from
`openxyos-runtime` if `openxyos` was left as a stub). Organization then
embeds `http://127.0.0.1:3780` without a manual 「启动边车」 click.
Downloading the latest openXYOS source uses the same native folder picker
as the project workdir (any drive), not a typed path only.
works) into the **live** workdir `%LOCALAPPDATA%\FreeOS\openxyos` during
Setup. `$INSTDIR\openxyos` and `$INSTDIR\openxyos-runtime` are sealed
backups only. Setup **aborts** if `node\node.exe` or `dist\index.html` is
missing, or if an install-time sidecar probe cannot reach
`/api/health/livez` — a README-only tree is not a successful install.

Why LocalAppData, written by an elevated installer: `$INSTDIR` is typically
`C:\Program Files\FreeOS`, which a later unelevated `FreeOS.exe` cannot
mutate. The app’s live root is `%LOCALAPPDATA%\FreeOS\openxyos`. Setup
reads the installing user’s `LOCALAPPDATA` environment variable (not NSIS
`$LOCALAPPDATA` after `SetShellVarContext all`, which is ProgramData) and
writes the complete FE+BE there so first launch does not pay a copy/unpack
cost. Organization then embeds `http://127.0.0.1:3780` without a manual
「启动边车」 click. Downloading the latest openXYOS source uses the same
native folder picker as the project workdir (any drive), not a typed path only.

Override the workdir with `FREEOS_OPENXYOS_HOME`.

Expand Down Expand Up @@ -92,11 +99,13 @@ would treat that tree as program files (unless it is named `User Data` /

On first open the shell:

1. Extracts the bundled portable runtime (Python host + Node + openXYOS).
2. Provisions the openXYOS workdir (`%LOCALAPPDATA%\FreeOS\openxyos` or
`{home}/openxyos`) from `$INSTDIR\openxyos` or `portable/org-sidecar`.
3. Starts the openXYOS sidecar on `http://127.0.0.1:3780` and waits until
`/api/health/livez` responds (first launch allows extra time).
1. Extracts the bundled portable **Python host** (the openXYOS FE+BE tree
was already written to `%LOCALAPPDATA%\FreeOS\openxyos` during Setup).
2. If that live workdir is already complete, skips any copy/unpack. A
copy from `$INSTDIR` / `portable/org-sidecar` is heal-only (other
Windows users, or a tree that Setup never populated).
3. Starts the openXYOS sidecar on `http://127.0.0.1:3780` from the live
workdir and waits until `/api/health/livez` responds.
4. Starts the FreeOS host with `FREEOS_HOME`, `FREEOS_ORG_ENABLE=1`, and
`FREEOS_OPENXYOS_HOME`.
5. Opens the desktop window on the host UI with a local guest session (no
Expand Down
33 changes: 22 additions & 11 deletions desktop/src/build/windows/nsis/project.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,28 @@ ManifestDPIAware true

LangString FINISH_RUN ${LANG_SIMPCHINESE} "运行 FreeOS"
LangString FINISH_RUN ${LANG_ENGLISH} "Run FreeOS"
LangString OPENXYOS_WORKDIR ${LANG_SIMPCHINESE} "创建 openXYOS 工作目录(安装目录与 %LOCALAPPDATA%\\FreeOS\\openxyos)"
LangString OPENXYOS_WORKDIR ${LANG_ENGLISH} "Create the openXYOS work directory (install dir and %LOCALAPPDATA%\\FreeOS\\openxyos)"
LangString OPENXYOS_WORKDIR ${LANG_SIMPCHINESE} "创建 openXYOS 工作目录(写入 %LOCALAPPDATA%\\FreeOS\\openxyos,安装期完成部署)"
LangString OPENXYOS_WORKDIR ${LANG_ENGLISH} "Create the openXYOS work directory (%LOCALAPPDATA%\\FreeOS\\openxyos; deploy during Setup)"
LangString OPENXYOS_COPY_ZIP ${LANG_SIMPCHINESE} "复制 openXYOS 运行包(前端+后端)"
LangString OPENXYOS_COPY_ZIP ${LANG_ENGLISH} "Copy the openXYOS runtime payload (frontend + backend)"
LangString OPENXYOS_EXTRACT ${LANG_SIMPCHINESE} "解压 openXYOS 前端与后端到安装目录\\openxyos"
LangString OPENXYOS_EXTRACT ${LANG_ENGLISH} "Extract openXYOS frontend and backend into the install dir\\openxyos"
LangString OPENXYOS_FE_OK ${LANG_SIMPCHINESE} "已就绪:openxyos\\dist\\index.html"
LangString OPENXYOS_FE_OK ${LANG_ENGLISH} "Ready: openxyos\\dist\\index.html"
LangString OPENXYOS_EXTRACT ${LANG_SIMPCHINESE} "解压 openXYOS 前端与后端到 %LOCALAPPDATA%\\FreeOS\\openxyos"
LangString OPENXYOS_EXTRACT ${LANG_ENGLISH} "Extract openXYOS frontend and backend into %LOCALAPPDATA%\\FreeOS\\openxyos"
LangString OPENXYOS_FE_OK ${LANG_SIMPCHINESE} "已就绪:%LOCALAPPDATA%\\FreeOS\\openxyos\\dist\\index.html"
LangString OPENXYOS_FE_OK ${LANG_ENGLISH} "Ready: %LOCALAPPDATA%\\FreeOS\\openxyos dist\\index.html"
LangString OPENXYOS_NODE_OK ${LANG_SIMPCHINESE} "已就绪:bundled Node(node.exe)"
LangString OPENXYOS_NODE_OK ${LANG_ENGLISH} "Ready: bundled Node (node.exe)"
LangString OPENXYOS_STAGED_OK ${LANG_SIMPCHINESE} "已从 openxyos-runtime 展开完整运行树"
LangString OPENXYOS_STAGED_OK ${LANG_ENGLISH} "Expanded the full runtime from openxyos-runtime"
LangString OPENXYOS_STAGED_OK ${LANG_SIMPCHINESE} "已从 openxyos-runtime 备份展开到本机工作目录"
LangString OPENXYOS_STAGED_OK ${LANG_ENGLISH} "Expanded the sealed runtime backup into the live workdir"
LangString OPENXYOS_EXTRACT_CODE ${LANG_SIMPCHINESE} "解压结束,退出码 "
LangString OPENXYOS_EXTRACT_CODE ${LANG_ENGLISH} "Extract finished, exit code "
LangString OPENXYOS_EXTRACT_FAIL ${LANG_SIMPCHINESE} "安装失败:未能解压完整的 openXYOS 运行环境(需要 node\\node.exe 与 dist\\index.html)。请重新下载安装包。"
LangString OPENXYOS_EXTRACT_FAIL ${LANG_ENGLISH} "Setup failed: openXYOS runtime is incomplete (need node\\node.exe and dist\\index.html). Download the installer again."
LangString OPENXYOS_EXTRACT_FAIL ${LANG_SIMPCHINESE} "安装失败:未能把完整的 openXYOS 运行环境解压到 %LOCALAPPDATA%\\FreeOS\\openxyos(需要 node\\node.exe 与 dist\\index.html)。请重新下载安装包。"
LangString OPENXYOS_EXTRACT_FAIL ${LANG_ENGLISH} "Setup failed: could not extract a complete openXYOS runtime into %LOCALAPPDATA%\\FreeOS\\openxyos (need node\\node.exe and dist\\index.html). Download the installer again."
LangString OPENXYOS_PROBE ${LANG_SIMPCHINESE} "正在启动本机 openXYOS 并检查 http://127.0.0.1:3780/api/health/livez"
LangString OPENXYOS_PROBE ${LANG_ENGLISH} "Starting local openXYOS and checking http://127.0.0.1:3780/api/health/livez"
LangString OPENXYOS_PROBE_OK ${LANG_SIMPCHINESE} "openXYOS 已通过安装期健康检查,首次打开无需再解压"
LangString OPENXYOS_PROBE_OK ${LANG_ENGLISH} "openXYOS passed the install-time health check; first launch will not unpack"
LangString OPENXYOS_PROBE_FAIL ${LANG_SIMPCHINESE} "安装失败:已解压 openXYOS,但 http://127.0.0.1:3780/api/health/livez 未就绪。请检查 3780 端口占用后重试安装。"
LangString OPENXYOS_PROBE_FAIL ${LANG_ENGLISH} "Setup failed: openXYOS is on disk but http://127.0.0.1:3780/api/health/livez did not become ready. Free port 3780 and run Setup again."
LangString UN_FREEOS_RUNNING ${LANG_SIMPCHINESE} "检测到 FreeOS 仍在运行(主程序、主机或组织侧车)。$\r$\n$\r$\n继续将结束这些进程,并删除安装目录中的程序文件。$\r$\n用户数据(%USERPROFILE%\.freeos)会保留。$\r$\n$\r$\n要继续卸载吗?"
LangString UN_FREEOS_RUNNING ${LANG_ENGLISH} "FreeOS is still running (shell, host, or organization sidecar).$\r$\n$\r$\nContinuing will stop those processes and remove program files from the install folder.$\r$\nUser data (%USERPROFILE%\.freeos) is kept.$\r$\n$\r$\nContinue uninstall?"

Expand Down Expand Up @@ -119,10 +125,15 @@ Section "uninstall"
!insertmacro wails.setShellContext
; Processes were already confirmed + stopped in un.onInit when present.

; Program-owned WebView2 / Wails cache — not FREEOS_HOME user data.
; Program-owned WebView2 / Wails cache + install-time live openXYOS tree.
; Not FREEOS_HOME / OCTOP_HOME user data. $LOCALAPPDATA after SetShellVarContext
; all is ProgramData; also wipe the installing user's LocalAppData.
!insertmacro wails.userLocalAppData
RMDir /r "$AppData\${PRODUCT_EXECUTABLE}"
RMDir /r "$LOCALAPPDATA\${PRODUCT_EXECUTABLE}.WebView2"
RMDir /r "$LOCALAPPDATA\${INFO_PRODUCTNAME}"
RMDir /r "$R6\${PRODUCT_EXECUTABLE}.WebView2"
RMDir /r "$R6\${INFO_PRODUCTNAME}"

Delete "$SMPROGRAMS\${INFO_PRODUCTNAME}.lnk"
Delete "$DESKTOP\${INFO_PRODUCTNAME}.lnk"
Expand Down
Loading
Loading