Electron-builder: Electron Builder AutoUpdater download-progress event is not called on MAC.

Created on 25 Jan 2017  Â·  13Comments  Â·  Source: electron-userland/electron-builder

Electron Version: 1.4.3
Electron Builder Version: 11.4.4
Target: macOS 10.12.2
Node Version: 7.2.1
NPM Version: 4.1.1

I am trying to use the electron-auto-updater module on MAC. Everything works all OK expect that the
download-progress event of auto updater never gets called.

I have the same solution for Windows and it works perfectly on it.

electron-updater mac

Most helpful comment

Thanks, this works. Now I can use the download-progress event on MacOS also. I can now show the users a good progress bar on Mac. Very helpful.

All 13 comments

FYI: electron-auto-updater renamed to electron-updater.

Yes, because under the hood we use native Squirrel.Mac updater and update downloaded by Squirrel.Mac.

@develar,
is there a feature-request (or a bug) reported to Squirrel.Mac?
Do you know if that's in progress?
Currently the UX of the autoupdate is crap: use will see that download has started and somewhere between 10 seconds - 5 hours they might see "Download complete" (if they didn't close the app in the mean time).

is there a feature-request (or a bug) reported to Squirrel.Mac?

I am not aware about it. You can search / file issue.

If Squirrel.Mac developers will reject this idea — probably I can make a PR to Squirrel.Mac.

electron-updater 2.0.0 released (electron-builder 18.5.1+ is recommended to use with this version).

No more any difference compared to windows version.

  • Full support of any existing electron-updater features on macOS.

    • Progress is supported.

    • Any dynamic or relative URL is supported.

    • Any provider as you want without any restrictions. Yes — private github repo is supported (#1370). Yes — Bintray is supported now (#1172).

  • sha512 integrity check.

Wants more? Stay tuned — lzma2 instead of zip or even direct support of DMG as update file is coming.

Be aware — feedback and testing is wanted.

what kind of event does the progress fires?
i've tried with both progress and download-progress, but nothing happen.
any chance to have some snippet?!
Thanks!

@biroplane did you find out how to get the download-progress?

Nope! still trying

@danieldbird @biroplane

I have the following code working all OK on Windows. I have used mainWindow.setProgressBar to show the progress at the taskbar icon. On MAC auto-update works but without progress.

Here is the package.json

{
  "name": "MyApp",
  "version": "2.0.2",
  "author": "Pratik Dabhi",
  "description": "Demo Offline Application",
  "main": "main.js",
  "build": {
    "appId": "MyApp",
    "mac-category-type": "public.app-category.productivity",
    "asar": false,
    "win": {
      "iconUrl": "http://demotest/favicon.ico",
      "certificateFile": "./certs/new.p12",
      "certificatePassword": "test!",
      "publish": {
        "provider": "generic",
        "url": "https://demotest/app/pc"
      }
    },
    "mac": {
      "target": [
        "zip"
      ],
      "publish": {
        "provider": "generic",
        "url": "https://demotest/app/mac"
      },
      "identity": "1234"
    }
  },
  "scripts": {
    "postinstall": "install-app-deps",
    "start": "electron ./app --enable-logging",
    "dev": "NODE_ENV='development' npm run start",
    "distWin": "build --ia32",
    "distMac": "build --mac"
  },
  "keywords": [
    "Demo"
  ],
  "dependencies": {
    "adm-zip": "^0.4.7",
    "async": "^2.1.4",
    "auto-updater": "^1.0.2",
    "electron-auto-updater": "^1.0.0",
    "progress-stream": "^1.2.0",
    "rimraf": "^2.5.4",
    "winston": "^2.3.0"
  },
  "devDependencies": {
    "electron": "^1.4.3",
    "electron-builder": "^11.4.4"
  }
}

Hope this helps you to find some missing pieces.

main.txt

@develar I believe this can be closed now - I can verify that I am observing download-progress events on MacOS as well as Windows.

Thanks, this works. Now I can use the download-progress event on MacOS also. I can now show the users a good progress bar on Mac. Very helpful.

How do I show download progress..?

I have coded something like this, download works and I am able to restart how do I incorporate progress?

`//Single export to check for and apply any available updates.
module.exports = () => {

//Check for GH (Releases)
autoUpdater.checkForUpdates()
//autoUpdater.checkForUpdatesAndNotify(); This Skips if application is not packed.

//Listern for Update found

autoUpdater.on('update-available',(updateInfo)=> {
//prompts user to start download
dialog.showMessageBox({
type: 'info',
title:'Update available',
message:'A new version '+ updateInfo.version+' of Psstracker is available on ' + updateInfo.releaseDate+ ' Do you want to update now?' ,
buttons:['Update','No']

}, buttonIndex => {

// If button 0 (Update), Start Download the update

if (buttonIndex===0) autoUpdater.downloadUpdate()

})

})

//Listen for update Downloaded

autoUpdater.on('update-downloaded',() =>{
// Prompt the user to install the update

dialog.showMessageBox({
type:'info',
title: 'Update Ready',
message: 'Install and restart Now?'

}, buttonIndex => {

//Install and restart if button 0 [Yes]

if (buttonIndex === 0) autoUpdater.quitAndInstall(false,true)

})

})

}`

Please can anyone help ?

Thanks, this works. Now I can use the download-progress event on MacOS also. I can now show the users a good progress bar on Mac. Very helpful.

How did you made this work sir. please can you help ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NPellet picture NPellet  Â·  3Comments

popod picture popod  Â·  3Comments

StickNitro picture StickNitro  Â·  3Comments

JohnWeisz picture JohnWeisz  Â·  3Comments

lbssousa picture lbssousa  Â·  3Comments