From bda9f4a56dccb16bc9fdfcb982ffe9ed33c3a1e5 Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Sun, 20 Apr 2025 11:32:48 +0800 Subject: [PATCH] Revert "refactor(ipc): remove Windows ARM update check from IPC handler and AboutSettings component" This reverts commit 4afd1c512eebedeb5b2cf2169a2af066af98b7e2. --- src/main/ipc.ts | 8 ++++++++ src/renderer/src/pages/settings/AboutSettings.tsx | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/main/ipc.ts b/src/main/ipc.ts index 62ce336f7b..82c051bd24 100644 --- a/src/main/ipc.ts +++ b/src/main/ipc.ts @@ -175,6 +175,14 @@ export function registerIpc(mainWindow: BrowserWindow, app: Electron.App) { // check for update ipcMain.handle(IpcChannel.App_CheckForUpdate, async () => { + // 在 Windows 上,如果架构是 arm64,则不检查更新 + if (isWin && arch().includes('arm')) { + return { + currentVersion: app.getVersion(), + updateInfo: null + } + } + const update = await appUpdater.autoUpdater.checkForUpdates() return { diff --git a/src/renderer/src/pages/settings/AboutSettings.tsx b/src/renderer/src/pages/settings/AboutSettings.tsx index 1d13ca84b0..b11f793f3d 100644 --- a/src/renderer/src/pages/settings/AboutSettings.tsx +++ b/src/renderer/src/pages/settings/AboutSettings.tsx @@ -1,6 +1,7 @@ import { GithubOutlined } from '@ant-design/icons' import IndicatorLight from '@renderer/components/IndicatorLight' import { HStack } from '@renderer/components/Layout' +import { isWindows } from '@renderer/config/constant' import { APP_NAME, AppLogo } from '@renderer/config/env' import { useTheme } from '@renderer/context/ThemeProvider' import { useMinappPopup } from '@renderer/hooks/useMinappPopup' @@ -32,6 +33,13 @@ const AboutSettings: FC = () => { const onCheckUpdate = debounce( async () => { + const { arch } = await window.api.getAppInfo() + + if (isWindows && arch.includes('arm')) { + window.open('https://cherry-ai.com/download', '_blank') + return + } + if (update.checking || update.downloading) { return }