diff --git a/package.json b/package.json index 12f8f41..6105771 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/index.js b/src/index.js index 679c427..3c81f43 100644 --- a/src/index.js +++ b/src/index.js @@ -78,4 +78,18 @@ autoUpdater.on("update-available", (_event, releseNotes, releseName) => { dialog.showMessageBox(dialogOpts, (response) = { }) -}); \ No newline at end of file +}); + +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() + }) +}) \ No newline at end of file