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:
- Created 7 years ago
- Comments:28 (11 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
@moJiXiang Fixed in 12.0.2 as #1129
electron-updater
1.3.0