Electron-builder: electron-updater will update even I don't call quitAndInstall after app quit

Created on 18 Jan 2018  Â·  3Comments  Â·  Source: electron-userland/electron-builder

  • Version: 2.18.2
  • Target: nsis
    autoUpdater = autoUpdater.autoUpdater
    autoUpdater.autoDownload = false
    autoUpdater.logger = console
    autoUpdater.on('checking-for-update', () => {
      console.log('Checking for update...');
    })
    autoUpdater.on('update-available', (info) => {
      console.log('Update available.' ,info);
      autoUpdater.downloadUpdate().then((path)=>{
        console.log('download path', path)
      }).catch((e)=>{
        console.log(e)
      })
    })
    autoUpdater.on('error', (err) => {
      console.log('Error in auto-updater. ' + err);
    })
    autoUpdater.on('update-not-available', (info) => {
      console.log('Update not available.', info);
    })
    autoUpdater.on('update-downloaded', (info) => {
      console.log('Update downloaded');
      let restart = window.confirm('shall we update ?')

      if(restart){
        autoUpdater.quitAndInstall()
      }   
    });

When I chose cancel on confirm, and the quitAndInstall won't reach, the app will update silently when it quit.
Can we give a config of this behaviour ?

electron-updater feature

Most helpful comment

electron-updater 2.20.0 — set autoInstallOnAppQuit to false.

All 3 comments

electron-updater 2.20.0 — set autoInstallOnAppQuit to false.

great !

electron-updater 2.20.0 — set autoInstallOnAppQuit to false.

Can we get this added to the documentation page for setting up autoupdate

Was this page helpful?
0 / 5 - 0 ratings