# Bootstrap Config + 自动更新管线
C 启动器(qqqide.exe)的唯一硬编码 URL → 下载配置 → 一切行为由配置驱动。
launcher-config.json
服务器真理源:https://gh555.com/dl/qqqide-up/launcher-config.json
{
"v": 1,
"update_host": "gh555.com",
"latest_path": "/dl/qqqide-up/latest.txt",
"r_path": "/dl/qqqide-up/r",
"use_https": true,
"follow_redirect": true,
"timeout_sec": 30,
"retry": 3,
"joker_exe": "gh555.com/joker.exe",
"first_run_r": "r"
}
字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
v | number | 配置版本(向前兼容) |
update_host | string | 更新服务器域名 |
latest_path | string | 版本号文件路径 |
r_path | string | 自解压载荷路径 |
use_https | bool | 是否 HTTPS |
follow_redirect | bool | WinHTTP 是否跟随 302 重定向 |
timeout_sec | number | HTTP 超时秒数 |
retry | number | 失败重试次数 |
joker_exe | string | Electron 二进制相对路径 |
first_run_r | string | 首次运行兜底载荷文件名 |
加载链
① 读本地缓存 (gh555.com/launcher-config.json)
② WinHTTP GET 服务器真理 → 合并覆盖
③ 都不行 → DEFAULT_CFG 内置兜底(编译进 qqqide.exe)
更新管线(非阻塞 100% 托管)
qqqide.exe 启动
├─ ① 加载配置(缓存→服务器→默认值)
├─ ② 若存在 .swap-ready → 原子交换 gh555.com-next → gh555.com(<1s,零阻塞)
│ ├─ 守卫 1: joker.exe 在跑(含旧实例残党)→ 绝不交换,保留标记等下次启动
│ ├─ 守卫 2: next 缺 joker.exe / .version / resources/app 任一 → 判残缺,删标记不交换
│ ├─ 崩溃恢复: 上次交换中途失败 → 从 gh555.com-old / Data.backup 自动还原
│ └─ 数据保全: 交换前 Data → Data.backup,交换后恢复;含 launcher-next.exe 自更新
├─ ③ ★ 立即启动 joker.exe → 用户先用(零阻塞)
├─ ④ 后台线程:
│ ├─ GET latest.txt → 比对 gh555.com/.version
│ ├─ 相同 → 跳过
│ └─ 不同 → 下载 r.next → 后台解压到 gh555.com-next(不阻塞使用)
│ → 写 .swap-ready → 下次启动原子交换(幂等: 已就绪则不再重复下载/解压)
└─ joker.exe 写 "ready" → 启动器退出
关键文件
| 文件 | 位置 | 说明 |
|---|---|---|
latest.txt | 服务器 dl/qqqide-up/ | 版本号(如 0.1.408) |
r | 服务器 dl/qqqide-up/ | 7zCon.sfx + payload.7z(~98MB) |
.version | gh555.com/ | 当前本地版本 |
r.next | 绿色包根 | 暂存的新载荷(下载完成后由后台解压消费) |
.version-next | 绿色包根 | 暂存版本号(与 r.next 成对) |
gh555.com-next/ | 绿色包根 | 后台解压出的新载荷(等 .swap-ready 触发交换) |
.swap-ready | 绿色包根 | 交换就绪标记(内容=目标版本号) |
gh555.com-old/ | 绿色包根 | 交换时的旧载荷(成功后删除,崩溃时还原用) |
Data.backup | 绿色包根 | 交换前的用户数据备份(成功后删除) |
launcher-next.exe | 绿色包根 | r 载荷自带的新启动器(交换时三明治替换 qqqide.exe) |
loading-status | gh555.com/ | 启动状态("ready"=完成) |
launcher-config.json | 绿色包根 + gh555.com/ | 配置缓存 |
单实例
Mutex 互斥防双开:二次启动时若 Mutex 被占且 launcher 窗口已销毁(旧实例仅剩后台线程)→ 找到 joker 主窗口前台化后退出。交换只发生在用户完全退出后的下次启动。
首次运行兜底
绿色包解压后 gh555.com/ 不存在:
joker.exe 缺失 → 找本地 r 文件(绿色包自带)→ 解压 → 启动
r 也不存在 → 从服务器下载 r → 解压 → 启动
与双轨更新的关系
| 更新轨 | 覆盖范围 | 触发 | 用户感知 |
|---|---|---|---|
C 启动器 r | gh555.com/ 下一切 | 重启两次 | 重启 |
| 壳层冷更 | shell-out/ | bootstrap 自动 | 重启 |
| 载荷热更 | Data/webapp/ | 启动后 20s 自动 | Ctrl+R |
三轨互补。r 覆盖最广(含 Electron 二进制、engines、PySide2),壳层/载荷覆盖高频小改动。
服务端部署
dist-pack/r→dl/qqqide-up/rdist-pack/latest.txt→dl/qqqide-up/latest.txtlauncher/launcher-config.json→dl/qqqide-up/launcher-config.json
CF Worker 路由:dl/qqqide-up/* → 透传对象存储。