Bug: Auto-update 下载完成后静默安装失败

### Bug: Auto-update 下载完成后静默安装失败 **版本**: 0.0.806 → 0.0.825(以及更早版本) **平台**: macOS (arm64) #### 现象 - 自动更新能正常检测和下载更新包到 ~/Library/Caches/alma-updater/ - 但下载完后从不自动安装,App 重启后仍是旧版本 - alma update install 同样返回 "restarting with new version" 但实际没生效 #### 根因 macOS 下 electron-updater 依赖 Squirrel.Mac 的 ShipIt 替换 App Bundle。当 Squirrel 首次启动安装失败(LaunchAgent 未注册),autoUpdater.quitAndInstall() 静默失败——API 返回了 {status: "installing"},底层什么都没做。 #### 代码层 ```js // /api/update/install handler this.app.post("/api/update/install", (e, t) => { t.json({ status: "installing" }), setTimeout(() => ui(), 1000) }) function ui() { Qr().quitAndInstall(!1, !0) } ``` 逻辑本身没问题,但 quitAndInstall() 失败时没有 try/catch、没有版本号校验、没有错误回调。 #### 建议修复 重启后做一次版本号自检,如果版本号未变就向前端返回安装失败。 #### 临时 workaround ```bash unzip -o ~/Library/Caches/alma-updater/pending/alma-*.zip -d /tmp/alma-update/ cp -R /tmp/alma-update/Alma.app /Applications/Alma.app ```

Please authenticate to join the conversation.

Upvoters
Status

In Review

Board
💡

Feature Request

Date

About 2 hours ago

Author

Wei Chang

Subscribe to post

Get notified by email when there are changes.