init changes for audo update
This commit is contained in:
parent
259f12b07a
commit
b93e5329d4
2 changed files with 21 additions and 0 deletions
|
|
@ -17,6 +17,9 @@ app.on("ready", () =>
|
||||||
createWin();
|
createWin();
|
||||||
|
|
||||||
initAccount();
|
initAccount();
|
||||||
|
|
||||||
|
/* Check for an update every minunte */
|
||||||
|
setInterval(autoUpdater.checkForUpdates, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
app.on("will-quit", terminateAudio);
|
app.on("will-quit", terminateAudio);
|
||||||
|
|
@ -26,3 +29,7 @@ app.on("activate", createWin);
|
||||||
|
|
||||||
// Prevents app from quitting on window close event
|
// Prevents app from quitting on window close event
|
||||||
app.on('window-all-closed', (e) => e.preventDefault());
|
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
14
src/update.js
Normal 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();
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue