develar/electron-updater

Force updater

Closed this issue · 2 comments

How can i force the updater to run?. So i am using electron-updater with electron-plugins. so the intention is that when a user clicks update or install on a plugin, this modifies my jason file on the fly and then i need to force an update.
I have tried to call updater.check and updater.update but they all fail in:

assert.ok(callback = values[2])

for what i get the next exeption always:

Uncaught Exception:
AssertionError: undefined == true
    at Object.<anonymous> (/home/knek/code/koteky/node_modules/electron-updater/lib/commands.js:73:10)
    at expect (/home/knek/code/koteky/node_modules/electron-updater/lib/commands.js:32:33)
    at ElectronCommands.check (/home/knek/code/koteky/node_modules/electron-updater/lib/commands.js:70:2)
    at EventEmitter.electron.ipcMain.on (/home/knek/code/koteky/main.js:74:13)
    at emitOne (events.js:77:13)
    at EventEmitter.emit (events.js:169:7)
    at EventEmitter.<anonymous> (/home/knek/code/koteky/node_modules/electron-prebuilt/dist/resources/atom.asar/browser/api/web-contents.js:134:25)
    at emitTwo (events.js:87:13)
    at EventEmitter.emit (events.js:172:7)

How are you calling those methods? You probably need at least a callback:

updater.check((err) => {
  if (err) console.error(err)
})

Same with update function.

that worked. When i read the code before i though the callback was the third parameter so i was calling like:

updater.check(null, null, (err) => {
  if (err) console.error(err)
})

similar with update.

thanks a lot for the help.