diff --git a/src/hooks/useUpdate.js b/src/hooks/useUpdate.js index a42df8c..89d3867 100644 --- a/src/hooks/useUpdate.js +++ b/src/hooks/useUpdate.js @@ -69,6 +69,15 @@ export function useUpdate() { error.value = err.message status.value = 'error' })) + + // macOS 手动安装提示 + if (api.onUpdateManualInstall) { + unsubList.push(api.onUpdateManualInstall((info) => { + console.log('macOS 需要手动安装更新:', info.path) + // 显示提示让用户知道需要手动安装 + alert(`更新已下载完成!\n\n请手动安装更新文件:\n${info.path}\n\n应用将退出。`) + })) + } } onMounted(() => { diff --git a/src/types/electron.d.ts b/src/types/electron.d.ts index e3c80fc..bd6a59e 100644 --- a/src/types/electron.d.ts +++ b/src/types/electron.d.ts @@ -150,6 +150,7 @@ export interface ElectronAPI { onUpdateProgress: (callback: (progress: UpdateProgress) => void) => () => void onUpdateDownloaded: (callback: (info: { version: string }) => void) => () => void onUpdateError: (callback: (error: { message: string }) => void) => () => void + onUpdateManualInstall: (callback: (info: { path: string }) => void) => () => void onGreetingStatsChanged: (callback: (stats: GreetingStats) => void) => () => void }