electron-builder: nsis-web and nsis, public GitHub: Electron-updater don't start downloading after update-available
After autoUpdater.checkForUpdates(), it emmits update-available but don’t start downloading.
I’m using GitHub to publish.
- Electron-updater - Version: 2.17.3
- Electron-builder - Version: 19.48.3
- Target: Windows | nsis-web
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 39 (20 by maintainers)
Commits related to this issue
- fix(electron-updater): Electron-updater don't start downloading after update-available #2377 — committed to electron-userland/electron-builder by develar 7 years ago
- chore: revert electron-updater to 2.16.3 The package upgrade is rejected due to a bug in electron-updater. For more information see https://github.com/electron-userland/electron-builder/issues/2377. — committed to FantasticFiasco/searchlight by FantasticFiasco 7 years ago
Hello @develar I just debugged a similar issue and it seem to be related to redirection.
May be it’s only for big bundles, but github is redirecting to amazonS3, which is not followed by electron’s net package because of the the redirect: “manual”.
I am not sure why you need to manually deal with redirection in this package, and I am confused by the structure between Provider <-> Executor <-> Updater and so on, so I won’t be pushing a PR. However, I got it fixed with this hacky monkey patch :
Hope that helps to pinpoint the issue and solve it more definitively.
I did some sleuthing, and found that in BaseUpdater.js:87 of electron-builder
const destinationFile = _path.join(tempDir, _path.posix.basename(fileInfo.url.pathname));should be:const destinationFile = _path.join(tempDir, _path.posix.basename(fileInfo.info.url));That will download the installer with the proper filename. I just found the fix, so I can’t exactly have a clean slate that is reproducible for submitting a new PR.
Electron 1.7.9 Electron-builder 19.49.0
can confirm same problem with 2.17.6
i switched down to 2.16.3 like @sheldhur suggested, and it does now download the file. new dependencies are electron - 1.7.9 electron-builder - 19.49.0 electron-updater - 2.16.3 provider - github (public) target - nsis
when i apply the updates though, (tried both quitAndInstall() – and just manually closing the app) i get the attached error, even though the file exists in the designated path, and the log appears to show no problems.
i’m so close to getting this thing working, any help or advice would be greatly appreciated!
Same issue here:
Auto-update works everywhere except on Windows.
Monkey patch from @aenario just works.
2.17.4 works for me, please verify.