init changes for audo update

This commit is contained in:
Andrew Gundersen 2022-05-16 06:35:09 -05:00
commit b93e5329d4
2 changed files with 21 additions and 0 deletions

View file

@ -17,6 +17,9 @@ app.on("ready", () =>
createWin();
initAccount();
/* Check for an update every minunte */
setInterval(autoUpdater.checkForUpdates, 60000);
});
app.on("will-quit", terminateAudio);
@ -26,3 +29,7 @@ app.on("activate", createWin);
// Prevents app from quitting on window close event
app.on('window-all-closed', (e) => e.preventDefault());
// Update when a new update is downloaded.
autoUpdater.on("update-downloaded", update);

14
src/update.js Normal file
View file

@ -0,0 +1,14 @@
const { app, autoUpdater } = require("electron");
autoUpdater.setFeedURL({ "https://crimata.com" });
async function update()
{
await dialog.showMessageBox({
buttons: ["Ok"],
title: "App Update",
detail: "A new version of the app is available"
});
autoUpdater.quitAndInstall();
}