feat: auto-updater integration

- Install electron-updater
- New updater.ts: check/download/install with progress events
- IPC: updater:check, updater:download, updater:install, updater:status
- Preload bridge for updater API
- electron-builder publish config (github provider)
- Fix build files path: out -> electron-dist
- i18n keys for updater notifications (zh-CN + en)
This commit is contained in:
2026-07-05 22:13:25 +08:00
parent d131a2732d
commit 405dfa77c4
9 changed files with 163 additions and 11 deletions
+6
View File
@@ -105,6 +105,12 @@ export interface ElectronAPI {
getCommandLog: () => Promise<any[]>
clearCommandLog: () => Promise<void>
}
updater: {
check: () => Promise<{ available: boolean; version?: string }>
download: () => Promise<{ success: boolean; error?: string }>
install: () => void
onStatus: (callback: (status: any) => void) => void
}
}
declare global {
+8
View File
@@ -120,6 +120,14 @@ const electronAPI = {
clearCommandLog: (): Promise<void> =>
ipcRenderer.invoke('redis:clearCommandLog'),
},
updater: {
check: (): Promise<any> => ipcRenderer.invoke('updater:check'),
download: (): Promise<any> => ipcRenderer.invoke('updater:download'),
install: () => ipcRenderer.invoke('updater:install'),
onStatus: (callback: (status: any) => void) => {
ipcRenderer.on('updater:status', (_e, status) => callback(status))
},
},
}
contextBridge.exposeInMainWorld('electronAPI', electronAPI)