Skip to content

Commit f1a844f

Browse files
committed
1.0.6
1 parent 3281055 commit f1a844f

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

main.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function createDefaultWindow() {
9898
}
9999

100100
autoUpdater.autoDownload = false;
101-
autoUpdater.autoInstallOnAppQuit = false;
101+
autoUpdater.autoInstallOnAppQuit = true;
102102

103103
autoUpdater.on('checking-for-update', () => {
104104
sendStatusToWindow('Checking for update...');
@@ -121,7 +121,21 @@ autoUpdater.on('download-progress', (progressObj) => {
121121
})
122122
autoUpdater.on('update-downloaded', (info) => {
123123
sendStatusToWindow('Update downloaded');
124-
autoUpdater.autoInstallOnAppQuit = false;
124+
dialog.showMessageBox({
125+
title: 'Install Now?',
126+
message: 'Would you like to install now or on exit?',
127+
type: 'question',
128+
buttons: [ 'On Exit', 'Now' ],
129+
defaultId: 1,
130+
cancelId: 0
131+
}).then(dialogResponse => {
132+
if (dialogResponse.response) {
133+
sendStatusToWindow('Starting Installation and Relaunch process');
134+
autoUpdater.quitAndInstall();
135+
} else {
136+
sendStatusToWindow('Will install on exit');
137+
}
138+
})
125139
});
126140
app.on('ready', function() {
127141
// Create the Menu

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "electron-updater-example",
3-
"version": "1.0.5",
3+
"version": "1.0.6",
44
"main": "main.js",
55
"description": "electron-updater example project",
66
"author": {

0 commit comments

Comments
 (0)