question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Auto update on macOS

See original GitHub issue
  • electron-builder 14.5.2
  • electron-updater 1.8.1
  • Target: mac

Similarly to issue #1310 , I’m setting up the auto-update feature on macOS as well. The publishing process is ok, but I’ve got an error during the update process:

  • if there is no update, everything is ok and I receive the “No update available” message correctly, but
  • if there is an update, I get this:
[Wed Mar 01 2017 09:55:58 GMT+0100 (CET)] INFO Checking for update
[Wed Mar 01 2017 09:55:58 GMT+0100 (CET)] INFO Checking for update...
[Wed Mar 01 2017 09:55:59 GMT+0100 (CET)] ERROR Error: TypeError: this.logger.warn is not a function
    at AutoUpdater.MacUpdater.nativeUpdater.on.it (/Users/Daniele/git/box/dist/mac/box.app/Contents/Resources/app.asar/node_modules/electron-updater/src/MacUpdater.ts:16:21)
    at emitTwo (events.js:106:13)
    at AutoUpdater.emit (events.js:191:7)
    at MacUpdater.onUpdateAvailable (/Users/Daniele/git/box/dist/mac/box.app/Contents/Resources/app.asar/node_modules/electron-updater/src/MacUpdater.ts:29:24)
    at /Users/Daniele/git/box/dist/mac/box.app/Contents/Resources/app.asar/node_modules/electron-updater/src/AppUpdater.ts:187:10
From previous event:
    at MacUpdater.doCheckForUpdates (/Users/Daniele/git/box/dist/mac/box.app/Contents/Resources/app.asar/node_modules/electron-updater/out/AppUpdater.js:237:11)
    at /Users/Daniele/git/box/dist/mac/box.app/Contents/Resources/app.asar/node_modules/electron-updater/src/AppUpdater.ts:142:25
    at Generator.next (<anonymous>)
    at runCallback (timers.js:651:20)
    at tryOnImmediate (timers.js:624:5)
    at processImmediate [as _immediateCallback] (timers.js:596:5)
From previous event:
    at MacUpdater._checkForUpdates (/Users/Daniele/git/box/dist/mac/box.app/Contents/Resources/app.asar/node_modules/electron-updater/out/AppUpdater.js:191:11)
    at MacUpdater.checkForUpdates (/Users/Daniele/git/box/dist/mac/box.app/Contents/Resources/app.asar/node_modules/electron-updater/src/AppUpdater.ts:124:35)
    at Timeout._onTimeout (/Users/Daniele/git/box/dist/mac/box.app/Contents/Resources/app.asar/main.js:251:17)
    at ontimeout (timers.js:365:14)
    at tryOnTimeout (timers.js:237:5)
    at Timer.listOnTimeout (timers.js:207:5)
[Wed Mar 01 2017 09:55:59 GMT+0100 (CET)] INFO Error in auto-updater.

This is the code looking for any updates:

autoUpdater.on('checking-for-update', () => {
    log.info('Checking for update...');
})
autoUpdater.on('update-available', (ev, info) => {
    log.info('Update available.');
})
autoUpdater.on('update-not-available', (ev, info) => {
    log.info('Update not available.');
})
autoUpdater.on('error', (ev, err) => {
    log.info('Error in auto-updater.');
})
autoUpdater.on('download-progress', (ev, progressObj) => {
    log.info('Downloading update...');
})
autoUpdater.on('update-downloaded', (ev, info) => {
    log.info('Update downloaded.  Will quit and install in 5 seconds.');
    // Wait 5 seconds, then quit and install
    setTimeout(function () {
        autoUpdater.quitAndInstall();
    }, 5000)
})
// Wait a second for the window to exist before checking for updates.
setTimeout(function () {
    autoUpdater.checkForUpdates();
}, 1000);

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:19 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
dventurinocommented, May 30, 2017

@alexcroox Xcode -> Preferences -> Account -> Manage certificates -> + -> macOs Development schermata 2017-05-30 alle 10 36 29

1reaction
dventurinocommented, May 31, 2017

@alexcroox yep! As @bill-pixvana said, you just have to share with them the .p12 file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

About background updates in macOS - Apple Support
In macOS Ventura or later, choose Apple menu > System Settings, click General in the sidebar, then click Software Update on the right....
Read more >
How to Enable Auto-Updates in macOS | The InfoSec Blog
Here's How to Automatically Update macOS: ... 1. Choose Apple Menu > System Preferences, then click Software Update. 2. Click the checkbox “Automatically...
Read more >
How to turn on automatic updates in macOS - TechRepublic
Click on the Apple menu in the upper left of the Finder bar. · Click on System Preferences. · Click on App Store....
Read more >
What every Apple user should know about software updates
You can choose to automatically download iOS app updates so you don't have to worry about doing this manually. Go to Settings >...
Read more >
How to Turn Off Auto Updates on Mac in Simple 3 Steps
Enable or Disable Automatic Software Updates on Mac · In your Menu bar, click on the Apple logo and select System Preferences. ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found