Add better update handler.

This commit is contained in:
Patrick Fic
2025-03-25 14:45:13 -07:00
parent 6b1876b0f4
commit 70e14fb5cc
15 changed files with 389 additions and 45 deletions

View File

@@ -10,6 +10,7 @@ import {
SettingsWatchedFilePathsRemove,
} from "./ipcMainHandler.settings";
import { ipcMainHandleAuthStateChanged } from "./ipcMainHandler.user";
import { autoUpdater } from "electron-updater";
// Log all IPC messages and their payloads
const logIpcMessages = (): void => {
@@ -87,4 +88,19 @@ ipcMain.on(ipcTypes.toMain.watcher.stop, () => {
StopWatcher();
});
ipcMain.on(ipcTypes.toMain.updates.download, () => {
log.info("Download update requested from renderer.");
autoUpdater.downloadUpdate();
});
ipcMain.on(ipcTypes.toMain.updates.checkForUpdates, () => {
log.info("Checking for updates from renderer.");
autoUpdater.checkForUpdates();
});
ipcMain.on(ipcTypes.toMain.updates.apply, () => {
log.info("Applying update from renderer.");
autoUpdater.quitAndInstall();
});
logIpcMessages();