chore: retire PowerShell update.ps1 and install_local.ps1
Superseded by src/launcher.py (Launcher.exe) + the portable layout from build.ps1. The PS prototype validated the flow; removed to avoid confusion with the old %LOCALAPPDATA% installer. docs/10 §16 and tasks 17.19 updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -253,8 +253,8 @@ HTTP 在线更新比内网共享面临更高风险,按以下层次防护:
|
||||
|
||||
1. **地基**:数据目录分离(第 5 节)。任何更新方案的前提。✅ 已实现。
|
||||
2. **只读通知**:启动时读取 `manifest.json` 比对版本,有新版仅提示。✅ 已实现——`services/update_service.py`(`check_for_update` / 版本比较,纯逻辑可测,支持 **`http(s)://` 源 + Basic Auth** 及本地路径;manifest 用 `utf-8-sig` 解码以容忍 BOM)+ 主窗口顶部通知横幅,后台线程检查(不可达不阻塞启动),更新源 / 凭据由 `update_source` / `update_user` / `update_pass` 配置。
|
||||
3. **自动安装(PowerShell 原型)**:启动器完整流程(下载 → 校验 → `app` 目录切换 → 启动 → `app.old` 回滚)。✅ 以 `scripts/update.ps1` 实现并端到端验证(HTTP 下载 zip + SHA-256 + 解压 + `app/app.old` 切换);`scripts/build.ps1` 产出 `version.txt` + zip + 写无 BOM `manifest.json`。**此为流程验证原型。**
|
||||
4. **改用 `Launcher.exe` + `~/.cmbot`(当前方向)**:🚧 将启动器改为 **Python + PyInstaller onefile** 编译的 `Launcher.exe`(复用 `services/update_service.py`),采用**便携布局**(解压任意可写目录即用,安装根 = `Launcher.exe` 所在目录),用户数据移到 **`~/.cmbot`**(`get_data_dir()` 三级回退,见第 5 节)。退休 `scripts/update.ps1` 与 `scripts/install_local.ps1`(`%LOCALAPPDATA%` 安装器)。待做:`src/launcher.py`、`build.ps1` 增产 `Launcher.exe`、安装根可写性检测、首次播种默认模板、真实环境端到端实测。
|
||||
3. **自动安装(PowerShell 原型,已退休)**:曾以 `scripts/update.ps1` + `scripts/install_local.ps1` 跑通整条流程(HTTP 下载 zip + SHA-256 + 解压 + `app/app.old` 切换),验证了设计可行。该原型已被阶段④取代并删除(git 历史可查)。
|
||||
4. **`Launcher.exe` + `~/.cmbot`(当前方向)**:✅ 已实现——`src/launcher.py`(Python + PyInstaller onefile,复用 `services/update_service.py`:下载 zip + SHA-256 + 解压 + `app/app.old` 切换 + 安装根可写性检测 + 首次播种默认模板到 `~/.cmbot`);`scripts/build.ps1` 产出 `Launcher.exe` + 便携布局 + 两个 zip(自更新载荷 / 便携安装包)+ 无 BOM `manifest.json`;`get_data_dir()` 三级回退(见第 5 节)。已用本地 HTTP server 真实端到端验证(下载→校验→切换→播种)。**待做**:在 Windows 上真实 PyInstaller 构建 + 解压到 D 盘真机端到端实测。
|
||||
5. **强制更新与保留策略**:补全 `mandatory` / `min_supported` 与 `app.old` 回滚策略。⛔ 未做。
|
||||
|
||||
启动器(`Launcher.exe`,目标)要点:
|
||||
|
||||
Reference in New Issue
Block a user