feat: add download and install update functionality in IPC
Some checks failed
Build / increment-version (push) Successful in 6s
Build / build-linux (push) Failing after 51s
Build / build-windows (push) Failing after 2m11s
Build / create-release (push) Has been skipped
Build Paarrot Windows / start-vm (push) Failing after 5m34s
Build Paarrot Windows / build (push) Has been skipped

This commit is contained in:
2026-03-25 06:56:13 +11:00
parent abc5ad66be
commit 90a0dad0ec
3 changed files with 17 additions and 6 deletions

View File

@@ -934,6 +934,21 @@ ipcMain.handle('install-update', () => {
return { success: true };
});
ipcMain.handle('download-and-install-update', async () => {
if (isDev) {
return { success: false, error: 'Updates are not available in development mode' };
}
try {
const result = await downloadGiteaUpdate();
if (!result.opened) {
installGiteaUpdate();
}
return { success: true, data: result };
} catch (error) {
return { success: false, error: error.message };
}
});
// Screen capture / desktopCapturer handler
ipcMain.handle('get-desktop-sources', async (event, opts) => {
try {