-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nsis-web and nsis, public GitHub: Electron-updater don't start downloading after update-available #2377
Comments
Do you use private GitHub? |
No, it's public GitHub |
2.17.4 works for me, please verify. |
Is your old version of app (update from) uses electron-updater 2.17.4? |
Yes, I generate two version with |
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. |
After upgrading to 2.17.4, download-progress can be called under Mac OS, but it can't be called under Windows |
@aenario If you use private GitHub provider, it is fixed in the electron-updater 2.17.5 |
Please in any comment about electron-updater issue provide: 1. provider (GitHub or s3 or ...) 2. target (nsis-web or nsis or appimage) |
electron-updater 2.17.6 released. If error still here, please enable debug logging to file and provide logs. Debug logging is cheap and doesn't lead to performance degradation, so, you can enable it and disable once you will verify that updater work. const log = require("electron-log")
log.transports.file.level = "debug"
autoUpdater.logger = log |
2.17.6 not working here, log:
autoUpdater code: autoUpdater.allowDowngrade = true;
autoUpdater.on('checking-for-update', () => {
log('Checking for update...');
ipc.sender('check-for-updates', {
message: 'Verificando atualizações...',
emitter: 'checking-for-update',
response: true,
});
});
autoUpdater.on('update-available', (info) => {
log('Update available.');
log(info);
ipc.sender('check-for-updates', {
message: 'Atualizações disponíveis...',
emitter: 'update-available',
response: true,
});
});
autoUpdater.on('update-not-available', (info) => {
log('No update available. More info:');
log(info);
ipc.sender('check-for-updates', {
message: 'Última versão instalada...',
emitter: 'update-not-available',
response: false,
});
});
autoUpdater.on('error', (err) => {
log.error(`Error in auto-update. ${err}`);
ipc.sender('check-for-updates', {
message: 'Problemas de conexão com o servidor...',
emitter: 'error',
response: false,
});
});
let setIntervalStop = false;
autoUpdater.on('download-progress', (progressObj) => {
let logMessage = `Download speed: ${helpers.bytesToSize(progressObj.bytesPerSecond)}/s`;
logMessage = `${logMessage} - Downloaded ${progressObj.percent.toFixed()}%`;
logMessage = `${logMessage} (${helpers.bytesToSize(progressObj.transferred)}/${helpers.bytesToSize(progressObj.total)})`;
log(logMessage);
ipc.sender('check-for-updates', {
message: 'Baixando atualizações',
percentage: `${progressObj.percent.toFixed()}%`,
emitter: 'download-progress',
response: true,
});
});
autoUpdater.on('update-downloaded', () => {
setIntervalStop = true;
log('Update downloaded');
ipc.sender('check-for-updates', {
message: 'Instalando atualizações...',
emitter: 'update-downloaded',
response: true,
});
});
ipcMain.on('quit-and-install', () => {
log('Quit and install update');
if (process.env.NODE_ENV === 'production' && process.env.BABEL_ENV !== 'test') {
autoUpdater.quitAndInstall(true, true);
}
});
ipcMain.on('check-for-updates', () => {
setImmediate(() => {
autoUpdater.allowPrerelease = allowPrerelease;
log(`Allow Prerelease: ${allowPrerelease}`);
autoUpdater.checkForUpdates();
});
}); |
@marceloavf Is debug enabled? |
@develar I used your code above I'll try to clean all log configuration and re-do the test |
#2379 merged into this issue. |
Same issue here:
Auto-update works everywhere except on Windows. Monkey patch from @aenario just works. |
Yup, this bug is easily reproducable. I have set up a test repository that showcases the issue here: This repo is just the
Some notes:
Here is the log file:
And then it just hangs there and doesn't download update. So this is a severe regression! |
Also, monkey patch from above works for me to fix this problem. I put it right before the line of:
Also, as a side note, @develar can you update the documentation? I think it should explain the difference between |
The same problem for 2.17.0-2.17.6 versions. But in 2.16.3 all is work :) |
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. 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! |
I did some sleuthing, and found that in BaseUpdater.js:87 of electron-builder 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 |
can confirm that the changes @gordonshieh94 suggested worked. updated BaseUpdater.js and file is now updating as intended. thanks! |
@gordonshieh94 It looks strange. But — as we do |
Please try electron-updater 2.17.7 |
The monkey patch posted above is still required. develar's commit does seem to address the ENOENT issue that metal-messiah and I are having though. |
Not working
|
Any progress on this issue? |
The package upgrade is rejected due to a bug in electron-updater. For more information see electron-userland/electron-builder#2377.
2.18.2 works for me
|
Works for me to |
Thanks for confirmation. |
@marceloavf did you solve this? I see a partial download (about 5mb) and my app just quits without emitting I'm having no help here: #2977 :\ |
@damianobarbati It's working since 2.18.2 here, one project in GitHub and another in Digital Ocean Spaces, also tested here on Windows 10, I'll take a look and give you any feedback if I find something. |
Thanks @marceloavf, I'm on:
Should I downgrade? |
My latest project is working on this versions @damianobarbati, using Digital Ocean Spaces:
Try them to see if something changes, you can also try to delay your autoUpdate functions too. |
@marceloavf what do you mean with "Try them to see if something changes, you can also try to delay your autoUpdate functions too."? |
You can use |
@marceloavf are you arguing that the |
It is reliable @damianobarbati, the point is that if you load your browserWindow, tray, etc you can have some undesired effects like app hang for a few seconds, |
After
autoUpdater.checkForUpdates()
, it emmitsupdate-available
but don't start downloading.I'm using
GitHub
to publish.The text was updated successfully, but these errors were encountered: