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

Most upvoted comments

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 :

const _mp = autoUpdater.httpExecutor.doRequest
    autoUpdater.httpExecutor.doRequest = function (options, callback) {
        const req = _mp.call(this, options, callback)
        req.on('redirect', () => req.followRedirect())
        return req
    }

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.

image

image

i’m so close to getting this thing working, any help or advice would be greatly appreciated!

Same issue here:

  • electron 1.7.9
  • electron-builder 19.49.0
  • electron-updater 2.17.6
  • provider: github (public)
  • target: nsis / dmg+zip / appimage

Auto-update works everywhere except on Windows.

Monkey patch from @aenario just works.

2.17.4 works for me, please verify.