8000 feat: Adding download-progress event to AutoUpdater by badams · Pull Request #1042 · electron-userland/electron-builder · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: Adding download-progress event to AutoUpdater #1042

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

Merged
merged 4 commits into from
Dec 28, 2016

Conversation

badams
Copy link
Contributor
@badams badams commented Dec 23, 2016

Adding a new event download-progress to the AutoUpdater, can be used like so

autoUpdater.addListener("download-progress", (e, progress) => {
    console.log(progress.percent);
});

payload received from this event is as follows:

{
    bytesPerSecond: 6365261,
    percent: 20.95,
    total: 61289092,
    transferred:12838731
}

#958 #948

@mention-bot
Copy link

@badams, thanks for your PR! By analyzing the history of the files in this pull request, we identified @maczikasz to be a potential reviewer.

@badams
Copy link
Contributor Author
badams commented Dec 23, 2016

Sorry my two PRs might not meet the guidelines, I didnt see that initially

@badams
Copy link
Contributor Author
badams commented Dec 28, 2016

@develar I've fixed the conflicts and added a test for this feature, is there anything else I need to do to get this merged?

@develar develar merged commit b3a0be0 into electron-userland:master Dec 28, 2016
@develar
Copy link
Member
develar commented Dec 28, 2016

@badams Thanks for complete PR with test. Merged.

@develar
Copy link
Member
develar commented Dec 28, 2016

electron-auto-updater@0.8.5 published with this great feature.

@joshuapinter
Copy link

Hey Guys. This might be a dumb question but does this work with Electron's native autoUpdater? We're using electron-forge and the following does not emit any events:

autoUpdater.on('download-progress', (progressObj) => {
  let log_message = "Download speed: " + progressObj.bytesPerSecond;
  log_message = log_message + ' - Downloaded ' + progressObj.percent + '%';
  log_message = log_message + ' (' + progressObj.transferred + "/" + progressObj.total + ')';
  console.log( log_message );
})

Just curious if this is electron-builder specific.

Thanks!

@badams
Copy link
Contributor Author
badams commented Jan 16, 2019

@joshuapinter no this is a custom feature in electron-builder

@joshuapinter
Copy link

@badams Thanks so much for the quick reply! Hell of a custom feature! Might be worth switching over at some point. :)

Thanks again!

@harrypotter033
Copy link

Hey Guys. This might be a dumb question but does this work with Electron's native autoUpdater? We're using electron-forge and the following does not emit any events:

autoUpdater.on('download-progress', (progressObj) => {
  let log_message = "Download speed: " + progressObj.bytesPerSecond;
  log_message = log_message + ' - Downloaded ' + progressObj.percent + '%';
  log_message = log_message + ' (' + progressObj.transferred + "/" + progressObj.total + ')';
  console.log( log_message );
})

Just curious if this is electron-builder specific.

Thanks!

did you able to fix this?
I am trying to track the progress of download too.. thanks

@joshuapinter
Copy link

@hmpargi We built our own custom downloader with electron-forge. Then months later we ended up switching the project to electron-builder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0