electron-builder icon indicating copy to clipboard operation
electron-builder copied to clipboard

AutoLaunch doesn't work in M1 Mac App Store

Open ethielknd opened this issue 1 year ago • 0 comments

  • Electron-Builder Version: ^23.1.0
  • Node Version: v16.15.0
  • Electron Version: 18.3.2
  • Target: M1 Mac App Store

In order to add autolaunch to our app I've been using the API provided by Electron, which is app.setLoginItemSettings and app.getLoginItemSettings We generate builds for Mac App Store and Mac DDL In Mac DDL the autolaunch works perfectly well, we have a UI checkbox for the user to enable/disable the autolaunch. If the box is checked the app appears in LoginItem and when restart/shutdown the laptop the app start when user is logged The problem is that for MAS the app is not added to LoginItems and restarting/shutdown the laptop doesn't starts the app after user logged in

What catch my attention is that in MAS the UI button works, the state is updated by calling through an IPC to Main process to a function which basically returns the value of app.getLoginItemSettings().openAtLogin. In fact, if I check the box and quit the app and start the app again the box is checked and then if I uncheck, quit and start the app again, the box is unchecked. But still, I can't see the app in the LoginItem

I'm not sure if I should post this into the Electron repo or here since this is something more for MAS

I cannot provide more information like package.json or code because of security reasons Any help or guidance is welcome

Thanks!

ethielknd avatar Aug 06 '22 02:08 ethielknd