question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NSIS Autoupdater Fails to update

See original GitHub issue
  • Version: 8.6.0
  • Target: Win64 Nsis

I use Github for updates and download works but on install it fails. My updater code is (imports are simplified):

const {autoUpdater} = require('electron-auto-updater')
function update () {
  setTimeout(function() {autoUpdater.checkForUpdates()}, 30000);
  autoUpdater.on('checking-for-update', function() {
    about.webContents.send('Updater' , {status:'checking'});
    tray.displayBalloon({
      title: 'Autoupdater',
      content: 'Es wird nach Updates geprüft!'
    })
  });

  autoUpdater.on("error", (err) => {
    about.webContents.send('Updater' , {status:'error'});
    console.log(err)
    crashInit()
    tray.displayBalloon({
      title: 'Autoupdater',
      content: 'Ein Fehler ist aufgetreten!'
    })
    //process.crash()
  })

  autoUpdater.on('update-available', function() {
    about.webContents.send('Updater' , {status:'update'});
      tray.displayBalloon({
        title: 'Autoupdater',
        content: 'Es gibt ein Update!'
      })
  });

  autoUpdater.on('update-not-available', function() {
    about.webContents.send('Updater' , {status:'no-update'});
    tray.displayBalloon({
      title: 'Autoupdater',
      content: 'Es gibt kein Update!'
    })
  });


  autoUpdater.on('update-downloaded', function (event, releaseNotes, releaseName, releaseDate, updateUrl, quitAndUpdate) {
    var index = dialog.showMessageBox({
      type: 'info',
      buttons: ['Restart', 'Later'],
      title: "Lornsenschule Vertretungsplan",
      message: ('The new version has been downloaded. Please restart the application to apply the updates.'),
      detail: releaseName + "\n\n" + releaseNotes
    });

    if (index === 1) {
      return;
    }

    quitAndUpdate()
  });
}

Following errorLog comes after starting the install:


Unhandled rejection Error: spawn UNKNOWN
    at exports._errnoException (util.js:1026:11)
    at ChildProcess.spawn (internal/child_process.js:313:11)
    at exports.spawn (child_process.js:392:9)
    at NsisUpdater.install (C:\Program Files\Lornsenschule Vertretungsplan\1.0                                                                                                                    .0\resources\app\node_modules\electron-auto-updater\out\nsis-auto-updater\src\                                                                                                                    NsisUpdater.js:194:61)
    at NsisUpdater.quitAndInstall (C:\Program Files\Lornsenschule Vertretungsp                                                                                                                    lan\1.0.0\resources\app\node_modules\electron-auto-updater\out\nsis-auto-updat                                                                                                                    er\src\NsisUpdater.js:178:18)
    at C:\Program Files\Lornsenschule Vertretungsplan\1.0.0\resources\app\node                                                                                                                    _modules\electron-auto-updater\out\nsis-auto-updater\src\NsisUpdater.js:158:32
    at NsisUpdater.<anonymous> (C:\Program Files\Lornsenschule Vertretungsplan                                                                                                                    \1.0.0\resources\app\main.js:81:5)
    at emitMany (events.js:127:13)
    at NsisUpdater.emit (events.js:201:7)
    at C:\Program Files\Lornsenschule Vertretungsplan\1.0.0\resources\app\node                                                                                                                    _modules\electron-auto-updater\out\nsis-auto-updater\src\NsisUpdater.js:157:28
From previous event:
    at C:\Program Files\Lornsenschule Vertretungsplan\1.0.0\resources\app\node                                                                                                                    _modules\electron-auto-updater\out\nsis-auto-updater\src\NsisUpdater.js:154:20
    at next (<anonymous>)
    at runCallback (timers.js:574:20)
    at tryOnImmediate (timers.js:554:5)
    at processImmediate [as _immediateCallback] (timers.js:533:5)
From previous event:
    at NsisUpdater.doCheckForUpdates (C:\Program Files\Lornsenschule Vertretun                                                                                                                    gsplan\1.0.0\resources\app\node_modules\electron-auto-updater\out\nsis-auto-up                                                                                                                    dater\src\NsisUpdater.js:166:11)
    at C:\Program Files\Lornsenschule Vertretungsplan\1.0.0\resources\app\node                                                                                                                    _modules\electron-auto-updater\out\nsis-auto-updater\src\NsisUpdater.js:117:36
    at next (<anonymous>)
From previous event:
    at NsisUpdater.checkForUpdates (C:\Program Files\Lornsenschule Vertretungs                                                                                                                    plan\1.0.0\resources\app\node_modules\electron-auto-updater\out\nsis-auto-upda                                                                                                                    ter\src\NsisUpdater.js:122:11)
    at Timeout._onTimeout (C:\Program Files\Lornsenschule Vertretungsplan\1.0.                                                                                                                    0\resources\app\main.js:30:38)
    at tryOnTimeout (timers.js:232:11)
    at Timer.listOnTimeout (timers.js:202:5)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:28 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
saatana97commented, Dec 25, 2017

I got the same question and I used electron-builder ^12.3.1,electron-updater ^1.16.0 can not run as administrator after auto update

0reactions
develarcommented, Jan 29, 2017

@moJiXiang Fixed in 12.0.2 as #1129 electron-updater 1.3.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Electron auto update fails silently when installing update on ...
It detects that there is an update which has already downloaded, and tries to install it, with the same result (progress bar fills...
Read more >
Update Check / Auto Update / Web Download - NSIS Forums
Update Check / Auto Update / Web Download Hi, I'm using NSIS as installer for some apps I wrote. This works great. Now...
Read more >
NSIS - electron-builder
NSIS. The top-level nsis key contains set of options instructing electron-builder on how it should build NSIS target (default target for Windows).
Read more >
Autoupdate | Scoop
Auto Update is a tool for package maintainers. It automatically checks for new versions of an app and updates the manifest accordingly.
Read more >
electron auto updater without code signing - You.com | The AI ...
You should sign your application so it does not trigger any operating system security checks. On macOS, the system can detect any change...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found