feat(desktop): add auto-update via electron-updater + manual CI trigger

This commit is contained in:
zhayujie
2026-06-23 20:37:27 +08:00
parent ec4c36f450
commit e9352e6984
12 changed files with 620 additions and 7 deletions

View File

@@ -39,5 +39,15 @@ contextBridge.exposeInMainWorld('electronAPI', {
return () => ipcRenderer.removeListener('menu-action', handler)
},
// Auto-update: trigger checks/download/install and subscribe to status.
checkForUpdate: () => ipcRenderer.invoke('update-check'),
downloadUpdate: () => ipcRenderer.invoke('update-download'),
installUpdate: () => ipcRenderer.invoke('update-install'),
onUpdateStatus: (callback: (status: unknown) => void) => {
const handler = (_event: unknown, status: unknown) => callback(status)
ipcRenderer.on('update-status', handler)
return () => ipcRenderer.removeListener('update-status', handler)
},
platform: process.platform,
})