优化
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
1
src/types/electron.d.ts
vendored
1
src/types/electron.d.ts
vendored
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user