Skip to content

Commit

Permalink
add Update Restart Ask
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederikHeinrich committed Mar 2, 2022
1 parent beb0f8d commit 680698e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "overlay",
"productName": "overlay",
"version": "1.0.2",
"version": "1.0.3",
"description": "My Electron application description",
"main": "src/index.js",
"scripts": {
Expand Down
16 changes: 15 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,18 @@ autoUpdater.on("update-available", (_event, releseNotes, releseName) => {
dialog.showMessageBox(dialogOpts, (response) = {

})
});
});

autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => {
const dialogOpts = {
type: 'info',
buttons: ['Restart', 'Later'],
title: 'Application Update',
message: process.platform === 'win32' ? releaseNotes : 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()
})
})

0 comments on commit 680698e

Please sign in to comment.