File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ function createDefaultWindow() {
9898}
9999
100100autoUpdater . autoDownload = false ;
101- autoUpdater . autoInstallOnAppQuit = false ;
101+ autoUpdater . autoInstallOnAppQuit = true ;
102102
103103autoUpdater . on ( 'checking-for-update' , ( ) => {
104104 sendStatusToWindow ( 'Checking for update...' ) ;
@@ -121,7 +121,21 @@ autoUpdater.on('download-progress', (progressObj) => {
121121} )
122122autoUpdater . 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} ) ;
126140app . on ( 'ready' , function ( ) {
127141 // Create the Menu
Original file line number Diff line number Diff line change 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" : {
You can’t perform that action at this time.
0 commit comments