Skip to content

Commit ca18cf7

Browse files
committed
1.0.4
1 parent 6ae567c commit ca18cf7

File tree

2 files changed

+27
-24
lines changed

2 files changed

+27
-24
lines changed

main.js

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,18 @@ function createDefaultWindow() {
9797
return win;
9898
}
9999

100+
autoUpdater.autoDownload = false;
101+
autoUpdater.autoInstallOnAppQuit = false;
102+
100103
autoUpdater.on('checking-for-update', () => {
101104
sendStatusToWindow('Checking for update...');
102105
})
103106
autoUpdater.on('update-available', (info) => {
104-
sendStatusToWindow('Update available.');
107+
sendStatusToWindow('Update available: ' + JSON.stringify(info));
108+
autoUpdater.downloadUpdate().then();
105109
})
106110
autoUpdater.on('update-not-available', (info) => {
107-
sendStatusToWindow('Update not available.');
111+
sendStatusToWindow('Update not available: ' + JSON.stringify(info));
108112
})
109113
autoUpdater.on('error', (err) => {
110114
sendStatusToWindow('Error in auto-updater. ' + err);
@@ -117,6 +121,7 @@ autoUpdater.on('download-progress', (progressObj) => {
117121
})
118122
autoUpdater.on('update-downloaded', (info) => {
119123
sendStatusToWindow('Update downloaded');
124+
autoUpdater.autoInstallOnAppQuit = false;
120125
});
121126
app.on('ready', function() {
122127
// Create the Menu
@@ -154,29 +159,27 @@ app.on('window-all-closed', () => {
154159
// Uncomment any of the below events to listen for them. Also,
155160
// look in the previous section to see them being used.
156161
//-------------------------------------------------------------------
157-
autoUpdater.autoDownload = false;
158-
autoUpdater.autoInstallOnAppQuit = false;
159162

160163
app.on('ready', function() {
161164
autoUpdater.checkForUpdates().then();
162165
});
163166

164-
autoUpdater.on('checking-for-update', (foo) => {
165-
log.info('got checking-for-update event: %s', JSON.stringify(foo));
166-
});
167-
autoUpdater.on('update-available', (info) => {
168-
log.info('got update-available event: %s', JSON.stringify(info));
169-
})
170-
autoUpdater.on('update-not-available', (info) => {
171-
log.info('got update-not-available event: %s', JSON.stringify(info));
172-
})
173-
autoUpdater.on('error', (err) => {
174-
log.info('got error event: %s', JSON.stringify(err));
175-
})
176-
autoUpdater.on('download-progress', (progressObj) => {
177-
log.info('got download-progress event: %s', JSON.stringify(progressObj));
178-
})
179-
autoUpdater.on('update-downloaded', (info) => {
180-
log.info('got update-downloaded event: %s', JSON.stringify(info));
181-
autoUpdater.autoInstallOnAppQuit = true;
182-
})
167+
// autoUpdater.on('checking-for-update', (foo) => {
168+
// log.info('got checking-for-update event: %s', JSON.stringify(foo));
169+
// });
170+
// autoUpdater.on('update-available', (info) => {
171+
// log.info('got update-available event: %s', JSON.stringify(info));
172+
// })
173+
// autoUpdater.on('update-not-available', (info) => {
174+
// log.info('got update-not-available event: %s', JSON.stringify(info));
175+
// })
176+
// autoUpdater.on('error', (err) => {
177+
// log.info('got error event: %s', JSON.stringify(err));
178+
// })
179+
// autoUpdater.on('download-progress', (progressObj) => {
180+
// log.info('got download-progress event: %s', JSON.stringify(progressObj));
181+
// })
182+
// autoUpdater.on('update-downloaded', (info) => {
183+
// log.info('got update-downloaded event: %s', JSON.stringify(info));
184+
// autoUpdater.autoInstallOnAppQuit = true;
185+
// })

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.3",
3+
"version": "1.0.4",
44
"main": "main.js",
55
"description": "electron-updater example project",
66
"author": {

0 commit comments

Comments
 (0)