From 0da479bed7ae0ce181bcecc43307ac19cb8eff52 Mon Sep 17 00:00:00 2001 From: ILoveBingLu Date: Thu, 2 Apr 2026 04:47:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8F=91=E5=B8=83=202.3.1=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=AE=89=E8=A3=85=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron/main.ts | 9 +++++++++ package.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/electron/main.ts b/electron/main.ts index 24c2a70..1c51860 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -70,6 +70,7 @@ let logService: LogService | null = null // 系统托盘实例 let tray: Tray | null = null +let isInstallingUpdate = false // 聊天窗口实例 let chatWindow: BrowserWindow | null = null @@ -221,6 +222,11 @@ function createWindow() { return } + if (isInstallingUpdate) { + app.isQuitting = true + return + } + // 如果是真正退出应用,不阻止 if (app.isQuitting) { return @@ -1325,6 +1331,7 @@ function registerIpcHandlers() { ipcMain.handle('app:downloadAndInstall', async (event) => { const win = BrowserWindow.fromWebContents(event.sender) + isInstallingUpdate = true // 监听下载进度 autoUpdater.on('download-progress', (progress) => { @@ -1333,12 +1340,14 @@ function registerIpcHandlers() { // 下载完成后自动安装 autoUpdater.on('update-downloaded', () => { + app.isQuitting = true autoUpdater.quitAndInstall(false, true) }) try { await autoUpdater.downloadUpdate() } catch (error) { + isInstallingUpdate = false console.error('下载更新失败:', error) throw error } diff --git a/package.json b/package.json index 55f4f44..fbaa79d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ciphertalk", - "version": "2.3.0", + "version": "2.3.1", "description": "密语 - 微信聊天记录查看工具", "author": "ILoveBingLu", "license": "CC-BY-NC-SA-4.0",