@@ -12,7 +12,6 @@ const fs = require('fs');
1212const os = require ( 'os' ) ;
1313const log = require ( 'electron-log' ) ;
1414const exec = require ( 'child_process' ) . exec ;
15- const { autoUpdater} = require ( 'electron-updater' ) ;
1615const ipc = require ( 'electron' ) . ipcMain ;
1716
1817// Fix for warning at startup
@@ -113,32 +112,6 @@ const generateMainWindow = () => {
113112 } ) ;
114113 } ;
115114
116- autoUpdater . on ( 'checking-for-update' , ( ) => {
117- log . info ( 'Checking for update...' ) ;
118- } ) ;
119- autoUpdater . on ( 'update-available' , ( info ) => {
120- log . info ( 'Update available.' ) ;
121- } ) ;
122- autoUpdater . on ( 'update-not-available' , ( info ) => {
123- log . info ( 'Update not available.' ) ;
124- } ) ;
125- autoUpdater . on ( 'error' , ( err ) => {
126- log . info ( 'Error in auto-updater. ' + err ) ;
127- } ) ;
128- autoUpdater . on ( 'download-progress' , ( progressObj ) => {
129- let logMessage = 'Download speed: ' + progressObj . bytesPerSecond ;
130- logMessage = logMessage + ' - Downloaded ' + progressObj . percent + '%' ;
131- logMessage = logMessage + ' (' + progressObj . transferred + '/' + progressObj . total + ')' ;
132- log . info ( logMessage ) ;
133- } ) ;
134- autoUpdater . on ( 'update-downloaded' , ( ev , info ) => {
135- // Wait 5 seconds, then quit and install
136- // In your application, you don't need to wait 5 seconds.
137- // You could call autoUpdater.quitAndInstall(); immediately
138- log . info ( 'Update downloaded' ) ;
139- autoUpdater . quitAndInstall ( ) ;
140- } ) ;
141-
142115 app . on ( 'activate' , ( ) => {
143116 if ( win === null || win === undefined ) {
144117 createWindow ( ) ;
@@ -152,8 +125,8 @@ const generateMainWindow = () => {
152125 } ) ;
153126
154127 app . on ( 'ready' , ( ) => {
155- autoUpdater . checkForUpdatesAndNotify ( ) ;
156128 createWindow ( ) ;
129+ require ( 'update-electron-app' ) ( ) ;
157130 } ) ;
158131
159132 const gotTheLock = app . requestSingleInstanceLock ( ) ;
0 commit comments