2

I want the user to be able to control what happens upon 'update-available'. No matter what I do here, autoUpdater seems to proceed with downloading the update.

How can I make autoUpdater NOT proceed with the download?

autoUpdater
    .on('error', function(error){
      // [Log and show dialog] ... 
    })
    .on('update-available', function(e) {
      // [Confirmation dialog] ... 
        if (downloadConfirmation === 0) {
            return;
        }
    })
    .on('update-downloaded',  function (event) {
     // [Restart now? Dialog] ... 
        if (index === 1) return;
        force_quit = true;
        autoUpdater.quitAndInstall();
    });

autoUpdater.checkForUpdates();
Deepak Thomas
  • 3,355
  • 4
  • 37
  • 39

1 Answers1

5

It is not possible. Or you can implement your own updater, please see https://github.com/electron/electron/blob/master/lib/browser/api/auto-updater/squirrel-update-win.js

Electron-builder NSIS auto-updater allows you to control it, but it is not yet ready (https://github.com/electron-userland/electron-builder/issues/529).

develar
  • 955
  • 3
  • 12
  • 16