feat: 增加 Client Windows 打包基础 (#92)

This commit is contained in:
chengma
2026-08-10 11:59:13 +08:00
parent 3bfaf44799
commit 99252aecce
14 changed files with 470 additions and 22 deletions
+22 -12
View File
@@ -183,25 +183,35 @@ one-file 每次启动都要解压到临时目录,启动慢,出错几乎没
```text
CMAutoBuy/ 整个文件夹拷到任何机器都能用
├── launcher.exe 双击这个启动
├── app/ 运行时依赖,用户不要动
│ ├── python310.dll
│ ├── PyQt5/Qt5/
│ │ ├── bin/ Qt5Core.dll / Qt5Gui.dll / Qt5Widgets.dll …
│ │ └── plugins/platforms/qwindows.dll
│ ├── qfluentwidgets/ qss 样式、字体、图标资源
│ ├── adbutils/binaries/ adb.exe
│ └── …
├── Launcher.exe 双击这个启动;它只负责启动主程序
├── app/ 主程序和运行时依赖,升级时整体替换
│ ├── CMAutoBuy.exe
│ ├── version.txt
│ └── dependencies/
│ ├── python310.dll
│ ├── PyQt5/Qt5/
│ │ ├── bin/ Qt5Core.dll / Qt5Gui.dll / Qt5Widgets.dll …
│ │ └── plugins/platforms/qwindows.dll
│ ├── qfluentwidgets/ qss 样式、字体、图标资源
│ ├── adbutils/binaries/adb.exe
│ └── …
└── data/ 本地数据,升级时保留(见 [03 数据模型](03-data-model.md) §2.1)
├── client.db
├── logs/
└── artifacts/
```
`app/` 这个名字来自 PyInstaller 的 `--contents-directory app` 参数(默认叫 `_internal`)。
主程序使用 PyInstaller one-dir,内部依赖目录通过 `--contents-directory dependencies`
固定命名。根目录的 `Launcher.exe` 是独立轻量启动器,为后续“关闭主程序后再替换
`app/`”保留边界;当前版本不联网、不下载,也不自动更新。
**升级方式:** 删掉 `launcher.exe` 和 `app/`,换成新版本,**`data/` 原样不动**。
数据库靠 `PRAGMA user_version` 自动迁移,见 [03](03-data-model.md) §2.3。
**当前升级方式:** 关闭程序后只替换 `app/`,**`Launcher.exe` 和 `data/` 原样不动**。
数据库靠 `PRAGMA user_version` 自动迁移,见 [03](03-data-model.md) §2.3。完整便携包
用于首次安装;更新包只包含 `app/`,不得包含 `data/`。
每次构建在 `client/release/` 生成更新包、完整便携包和
`autobuy——manifest.json`。清单至少记录版本、文件名、字节大小和 SHA256;SHA256
用于发现下载损坏,不等同于发布者身份认证。联网更新和清单签名必须另建工单。
**已知风险点**(打包工单必须逐项验证):