Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
df01258dfc
5 changed files with 100 additions and 47 deletions
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
import { protocol } from "electron";
|
||||
import { protocol, autoUpdater, dialog } from "electron";
|
||||
import { initApp } from './background/init';
|
||||
|
||||
// Scheme must be registered before the app is ready
|
||||
|
|
@ -23,3 +23,24 @@ const isDev = require('electron-is-dev');
|
|||
initApp(isDev);
|
||||
|
||||
})();
|
||||
|
||||
// Auto app updates.
|
||||
if (!isDev) {
|
||||
autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => {
|
||||
const dialogOpts = {
|
||||
type: 'info',
|
||||
buttons: ['Restart', 'Later'],
|
||||
title: 'Application Update',
|
||||
message: releaseName,
|
||||
detail: 'A new version has been downloaded. Restart the application to apply the updates.'
|
||||
}
|
||||
|
||||
dialog.showMessageBox(dialogOpts).then((returnValue) => {
|
||||
if (returnValue.response === 0) autoUpdater.quitAndInstall()
|
||||
})
|
||||
})
|
||||
|
||||
setInterval(() => {
|
||||
autoUpdater.checkForUpdates()
|
||||
}, 5000)
|
||||
}
|
||||
Loading…
Reference in a new issue