Closed
Description
- Electron builder version: 19.6.3
- Electron updater version: 2.4.1
- Target: Windows 10
We have our app built using the latest electron-builder and latest electron (1.7.3) but we are seeing issues on windows 10 while updating. It prompts for the download but does not update the app after quitting the old version of the app. Checking the version of the app in installed path shows that it is still on the older version.
Activity
develar commentedon Jun 22, 2017
Works for me and confirmed by other users. Do you call
quitAndInstall
explicitly or not?develar commentedon Jun 22, 2017
Works for me in both cases — explicit exit or install on quit. Please provide more details and debug log (https://github.com/electron-userland/electron-builder/wiki/Auto-Update#debugging).
ngprasad commentedon Jun 22, 2017
Yes, I am calling autoUpdater.quitAndInstall() explicitly.
ngprasad commentedon Jun 22, 2017
@develar Are you sure you are on the same version of electron (1.7.3) when you tested it? Because the issue doesn't happen on any earlier versions of electron.
develar commentedon Jun 22, 2017
Yes — https://github.com/develar/onshape-desktop-shell/blob/master/package.json#L55
Please provide debug log.
JaisonJose commentedon Jun 23, 2017
@develar I work with @ngprasad
debug log shows this error:
2017-06-23 11:10:41.885 [ERROR] Error: Error: spawn EACCES
at exports._errnoException (util.js:1050:11)
at ChildProcess.spawn (internal/child_process.js:319:11)
at exports.spawn (child_process.js:390:9)
at NsisUpdater.install (C:\Program Files\QuickBooks\resources\app.asar\rel\node_modules\electron-updater\src\NsisUpdater.ts:116:7)
at NsisUpdater.quitAndInstall (C:\Program Files\QuickBooks\resources\app.asar\rel\node_modules\electron-updater\src\NsisUpdater.ts:86:14)
at Function.o (C:\Program Files\QuickBooks\resources\app.asar\rel\src\updater.js:1:2606)
(Issue looks very similar to #1636)
Note: We are facing this issue only on Windows 10, on Mac and on Windows 7, it works fine.
"electron": "1.7.3",
"electron-builder": "^19.6.3"
My Windows 10 has Powershell (PSVersion 5.0.10586.672)
JaisonJose commentedon Jun 23, 2017
I tried "electron-builder": "^19.7.3" too.
develar commentedon Jun 26, 2017
Please provide your electron-builder config.
itsWeller commentedon Jun 26, 2017
@develar I work with @JaisonJose and @ngprasad.
Here's our electron-builder-release config; all "MOCK" strings are just replacements of info directly related to our application.
itsWeller commentedon Jul 5, 2017
@develar Following up, any updates regarding this issue, or anything we can do to help reproduce or debug?
develar commentedon Jul 5, 2017
Sorry for delay. I am going to check per machine update tomorrow morning CET.
develar commentedon Jul 12, 2017
I cannot reproduce. perMachine works correctly for me. Could you please show your updater code (where do you call quitAndInstall)?
JaisonJose commentedon Jul 12, 2017
autoUpdater.on('update-downloaded', (event) => {
const options = {type: 'info', buttons: ['Update Now'], defaultId: 0, noLink: true, title: constants.updater_title, message: 'A new version is ready to install.', detail: 'The update will proceed once you click Update Now.'};
const callback = (buttonIndex) => {
if (buttonIndex === 0) {
autoUpdater.quitAndInstall();
}};
dialog.showMessageBox(null, options, callback);
}
@develar Could you please let us know the electron and electron-builder versions that you used for checking this issue. (I assume you have used Windows 10 machine).
develar commentedon Jul 12, 2017
Ouch... please do not call autoupdater quit from dialog callback. Please wrap in setImmediate.
develar commentedon Jul 12, 2017
Please see #1604 (comment)
ngprasad commentedon Jul 17, 2017
@develar We investigated the dialog but it still failed. Then we changed perMachine setting to false and it works.
We downloaded the sample app and tried setting perMachine setting to true with Electron v. 1.7.3 on Windows 10 x64, and that fails with the same error. Previous electron versions (1.6.x) with the same settings (perMachine=true, Windows 10 x64) work as expected. Here's the error log:-
We think there might still be an issue with perMachine=true on Electron 1.7.3 and Windows 10 x64.
Can you please look into it?
JaisonJose commentedon Aug 2, 2017
@develar Did you get a chance to look at this issue with sample app?
akorchev commentedon Sep 25, 2018
I think this code is supposed to handle that error and run the installer with elevated rights. However
child_process.spawn
never throws exceptions so that code is never executed. It emitserror
event instead.stale commentedon Jul 2, 2019
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.