79743228

Date: 2025-08-22 09:47:42
Score: 0.5
Natty:
Report link

You need to listen to autoUpdater events, example:

import { autoUpdater } from 'electron';

...

autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => {
  const dialogOpts = {
    type: 'info',
    buttons: ['Restart', 'Later'],
    title: 'Application Update',
    message: process.platform === 'win32' ? releaseNotes : releaseName,
    detail:
      'A new version has been downloaded. Restart the application to apply the updates.'
  }

  dialog.showMessageBox(dialogOpts).then((returnValue) => {
    if (returnValue.response === 0) autoUpdater.quitAndInstall()
  })
})

More in this tutorial.

You probably should do it outside of the _checkForUpdates function, so you don't attach multiple listeners to one event.

Reasons:
  • Blacklisted phrase (1): this tutorial
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: rajniszp