@@ -97,14 +97,18 @@ function createDefaultWindow() {
9797 return win ;
9898}
9999
100+ autoUpdater . autoDownload = false ;
101+ autoUpdater . autoInstallOnAppQuit = false ;
102+
100103autoUpdater . on ( 'checking-for-update' , ( ) => {
101104 sendStatusToWindow ( 'Checking for update...' ) ;
102105} )
103106autoUpdater . on ( 'update-available' , ( info ) => {
104- sendStatusToWindow ( 'Update available.' ) ;
107+ sendStatusToWindow ( 'Update available: ' + JSON . stringify ( info ) ) ;
108+ autoUpdater . downloadUpdate ( ) . then ( ) ;
105109} )
106110autoUpdater . on ( 'update-not-available' , ( info ) => {
107- sendStatusToWindow ( 'Update not available.' ) ;
111+ sendStatusToWindow ( 'Update not available: ' + JSON . stringify ( info ) ) ;
108112} )
109113autoUpdater . on ( 'error' , ( err ) => {
110114 sendStatusToWindow ( 'Error in auto-updater. ' + err ) ;
@@ -117,6 +121,7 @@ autoUpdater.on('download-progress', (progressObj) => {
117121} )
118122autoUpdater . on ( 'update-downloaded' , ( info ) => {
119123 sendStatusToWindow ( 'Update downloaded' ) ;
124+ autoUpdater . autoInstallOnAppQuit = false ;
120125} ) ;
121126app . 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
160163app . 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+ // })
0 commit comments