Add self-update feature via GitHub Releases
Checks for updates on startup (silent, badge on button if available) and on manual click. Downloads new portable .exe to temp dir, creates a batch script to swap the running executable after quit, then relaunches. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+14
@@ -19,5 +19,19 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
||||
console.error('Extension cookie handler error:', error);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// Self-update functionality
|
||||
checkForUpdates: () => ipcRenderer.invoke('check-for-updates'),
|
||||
downloadAndInstallUpdate: (params) => ipcRenderer.invoke('download-and-install-update', params),
|
||||
getCurrentVersion: () => ipcRenderer.invoke('get-current-version'),
|
||||
onUpdateDownloadProgress: (callback) => {
|
||||
ipcRenderer.on('update-download-progress', (event, data) => {
|
||||
try {
|
||||
callback(data);
|
||||
} catch (error) {
|
||||
console.error('Update download progress handler error:', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user