electron-builder: download-progress does not emit proper values (nsis-web, differentialPackage)

I have problem with update events when using nsis-web. The thing is that download-progress event is only taking into consideration the .exe file which is 500KB and when I want to display some progressbar it is downloading 500KB and showing instantly 100%. After that it is downloading 7z file in the background and I cannot see progress of it - this is bad especially as I plan to have large files included in app.

package.json

  "scripts": {
    "publish": "build --x64 --ia32 --windows nsis-web -p always"
  },
  "devDependencies": {
    ...
    "electron": "1.7.10",
    "electron-builder": "19.54.0",
    "electron-publisher-s3": "^19.55.2"
  },
  "dependencies": {
    ...
    "electron-log": "2.2.14",
    "electron-updater": "2.20.0"
  }

electron-build.json

{
  "appId": "com.kkl.test",
  "publish": [
    {
      "provider": "s3",
      "bucket": "somebucket",
      "region": "eu-central-1"
    }
  ],
  "productName": "test",
  "directories": {
    "output": "app-builds"
  },
  "win": {
    "target": [
      "nsis-web"
    ]
  },
  "nsisWeb": {
    "differentialPackage": true,
    "oneClick": false,
    "perMachine": true,
    "allowElevation": true,
    "allowToChangeInstallationDirectory": true,
    "unicode": true,
    "runAfterFinish": true,
    "deleteAppDataOnUninstall": true
  }
}

log.log file:

[2018-01-24 21:29:57.751] [info] Found version 0.0.4-test (url: test Web Setup 0.0.4-test.exe)
[2018-01-24 21:29:57.751] [info] { info: 
   { version: '0.0.4-test',
     files: [ [Object] ],
     path: 'test Web Setup 0.0.4-test.exe',
     sha512: 'jcijdawbJlHYIm6vf43RQeMTm1QLMhjZ1J3rviGW6XRwvd/J7Q3RC6I4zihJjh97CjUe+KJ7X1H/5WVLICLlKw==',
     packages: { ia32: [Object], x64: [Object] },
     sha2: 'c9e920597c31b826e332614ac824a69dc30bd0b01586fce737fe4fe09eca4153',
     releaseDate: '2018-01-24T15:47:49.189Z' },
  type: 'update-available' }
[2018-01-24 21:29:57.753] [info] Downloading update from test Web Setup 0.0.4-test.exe
[2018-01-24 21:29:58.064] [info] { progressObj: 
   { total: 511884,
     delta: 511884,
     transferred: 511884,
     percent: 100,
     bytesPerSecond: 2337370 },
  type: 'progress' }
[2018-01-24 21:29:58.709] [info] File has 10350 changed blocks
[2018-01-24 21:29:58.713] [info] Full: 246,918.68 KB, To download: 211,158.25 KB (86%)
[2018-01-24 21:29:58.718] [info] Differential download: https://bucket.s3.amazonaws.com/somefile-0.0.4-test-x64.nsis.7z

Is there a way to use differentialPackage and nicely show download progress of all files? Or maybe there is something wrong in my setup ?

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 6
  • Comments: 33 (4 by maintainers)

Commits related to this issue

Most upvoted comments

I need this feature too

I had this problem too, as a workaround i made this Based on messages which are logged in console by updater im calculating percentage and speed

In “differential download” case, ‘download-progress’ doesn’t emit on windows 10.

the event is not working in 21.2.0

We have also run into the same issue with our app. Would be great to see this feature implemented soon… Guess I’ll have to show a “spinner” until I can get progress. 😃

Differential downloader doesn’t emit progress events. This feature is not yet implemented, and no plans for this month (a lot of other more important issues).

19.54.0 To download: 211,158.25 KB (86%)

Are both versions were build using electron-builder 19.54.0?

@soubhikchatterjee @aultuser @the3moon @chesucr - Hi, try this module electron-differential-updater… it is built on top of electron-builder and help u with the fix. We are done with the documentation It also has differential update for mac also.

Thanks !! Are you going to merge that project into the electron-updater?? @harshitsilly

@chesucr right now we have features like the differential update for mac(zip) , have app updater cache location to user app support location + this one. I highly doubt if we raise pr for all these features then it will get merged… what we want to have is the electron-updater enabled with these functionalities …we will try to close bugs or have features that electron builder community does not takes… Maybe in the future, if things work well then there is a chance of pr or for particular this fix we can have the pr but for that, we have to adhere to the electron-builder guidelines which can take time.

@Romain-P On windows the ‘download-progress’ callback is called. On Linux it isn’t. I’m not sure how to check the console.log of the main.js electron process on windows, but I have a progress bar that initiates from the download-progress callback, it works on Windows, it doesn’t work on Linux. I changed the progress bar to be indefinite if I’m running on Linux, that’s the temporary solution I’m going with for now.

The only reason why it is not implemented — lack of time. “Download plan” is computed in advance, so, we can report progress during differential downloading.