When updating to the latest stable version (21.2.0) it seems to never enter the update-downloaded event. The last log present is "Full: 51,655.77 KB, To download: 51,584.6 KB (100%)". It stays there and it never does the quit and install part of the process.
My logic on the update-downloaded event is as follows:
autoUpdater.on('update-downloaded', async (updateInfo) => {
log.info("UPDATE DOWNLOADED... INSTALLING")
setImmediate(() => {
autoUpdater.quitAndInstall();
app.exit()
})
})
This logic has worked all the time when updating my app with electron-builder version 20.44.4, but it breaks whenever the current version is 20.44.4 and the new version to download has any 21.x.x electron-builder version as a dependency. (I also tried on the latest 22.2.0 version without any luck, same behavior as before). I would like to be able to update electron-builder to the latest version without compromising the auto-update feature and be able to automatically update electron-builder on the hundreds of devices that are already running our app on 20.44.4 electron-builder version.
Thanks!
Do you have spaces in your productName?
I have noticed, that the value changed inside the latest-mac.yml from my app name to my-app-name. So the links won't work anymore since the binary download link now escapes a space instead of a dash.
Hi!
No, I don't have any spaces on my productName, it's just one word. And the thing is that it seems to detect the new version that's available on my server, but it just isn't capable of finishing downloading it, or it never enters the 'update-downloaded' event for some weird reason
This happened to me too!
@cegonzalv is correct that it detects the download, it downloads, send a notification that download is complete but then when you restart the app, it is still on older version and the notification keeps coming up.
Luckily I am only on the alpha of my v2 for my app. So I didn't care much. I simply upgraded to the latest version for next alpha and manually updated it. I will be too cautious in production while upgrading electron-builder and updater.
hi same thing for me @amargautam I think what @cegonzalv problem and my is different from you, it does not detect any download
isn't capable of finishing downloading
or it never enters the 'update-downloaded' event
@cegonzalv from which version it was working before for you ?
I use the last release 22.3.2 with nsis target
I have the same issue like @amargautam has.
is correct that it detects the download, it downloads, send a notification that download is complete but then when you restart the app, it is still on older version and the notification keeps coming up.
Do you have any solutions to resolve that? We couldn't update electron-builder to the latest version because LIVE version of the app uses electron-builder below 20.44.4.
@almamlaka I deployed my application for the first time on version 20.44.4 and it all worked fine. It's just when I try to update electron-builder to the latest version that auto-update feature fails, so I end up having to revert the change and stay on 20.44.4. I would like to be able to update electron builder to the latest version without the auto-update feature breaking completely!
We resolved the problem in our project.
It turned out it was our code that prevents from close the application window.
win.on("close", event => {
event.preventDefault();
win.setSkipTaskbar(true);
win.hide();
win.setSkipTaskbar(false);
return false;
});
So the root cause was that method. If we remove them from the old app version we're ready to update electron builder to the newest version without auto-update process breaking.
This workaround resolved the whole problem
win.on("close", event => {
if (forceQuitOnAutoUpdate) {
return true;
}
...
}
autoUpdater.on("update-downloaded", () => {
forceQuitOnAutoUpdate = true;
autoUpdater.quitAndInstall();
});
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Most helpful comment
hi same thing for me @amargautam I think what @cegonzalv problem and my is different from you, it does not detect any download
@cegonzalv from which version it was working before for you ?
I use the last release 22.3.2 with nsis target