Electron-builder: NSIS autoUpdater.setFeedURL throws error

Created on 12 Jan 2017  Â·  5Comments  Â·  Source: electron-userland/electron-builder

  • electron-builder: 11.2.4
  • electron-auto-updater: 0.10.1

  • Target: win32


We have separate release channels based on the configuration of the user (beta|stable).
Using the "hardcoded" configuration on package.json works fine but when we try to change the feed with autoUpdater.setFeedURL() it throws an error.

package.json

"build": {
  "appId": "app.test",
  "win": {
    "target": "nsis",
    "signingHashAlgorithms": "sha256",
    "certificateFile": ".certs/testcert.pfx",
    "certificatePassword": "123456789"
  },
  "publish": {
    "provider": "generic",
    "url": "https://releases.test.com/channels/stable"
  }
},

main.js

...
mainWindow.webContents.once("did-frame-finish-load", function(event) {
  dialog.showMessageBox(mainWindow, {title: "autoUpdater", message: 'checking for updates....'});
  autoUpdater.setFeedURL('https://releases.test.com/channels/beta'); // throws error
  autoUpdater.checkForUpdates();
})
...

error

...\resources\electron.asar\renderer\api\remote.js:217 Uncaught Error: Could not call remote function ''. Check that the function signature is correct. Underlying error: Please pass PublishConfiguration object
Error: Could not call remote function ''. Check that the function signature is correct. Underlying error: Please pass PublishConfiguration object
    at callFunction (...\resources\electron.asar\browser\rpc-server.js:235:11)
    at EventEmitter.<anonymous> (...\resources\electron.asar\browser\rpc-server.js:342:5)
    at emitMany (events.js:127:13)
    at EventEmitter.emit (events.js:201:7)
    at WebContents.<anonymous> (...\resources\electron.asar\browser\api\web-contents.js:231:13)
    at emitTwo (events.js:106:13)
    at WebContents.emit (events.js:191:7)
electron-updater feature

Most helpful comment

You can expect that this issue will be fixed next week (or earlier), after #1089.

All 5 comments

Hmm... it seems if you set as string, we should just update url in the default publish configuration. Reopened — usability issue.

BTW, generic provider supports channel — you can set channel to beta and file beta.yml will be generated/requested instead of default latest.yml (default channel name latest).

You can use --em.build.publish.channel=beta to inject.

Ok, got it. Thank you so much for your reply (and this great package!)

You can expect that this issue will be fixed next week (or earlier), after #1089.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StickNitro picture StickNitro  Â·  3Comments

ccorcos picture ccorcos  Â·  3Comments

NPellet picture NPellet  Â·  3Comments

philcockfield picture philcockfield  Â·  3Comments

jhg picture jhg  Â·  3Comments