Feature request: allow for Mac App Store compatible auto-launching
adam-lynch opened this issue · 4 comments
- Version: N/A
- Target: Mac App Store
We have this module auto-launch which executes applescript commands to set an app to auto-launch on startup. We're changing it to be file-based (i.e. put a .plist
in the user's /Library/LaunchAgents
. Both methods would cause an app to rejected by the Mac App Store, definitely the latter anyway as it reaches out of the app sandbox.
http://martiancraft.com/blog/2015/01/login-items/ describes how to have MAS-friendly auto-launching. It requires you to bundle a separate app/executable (and this would need to be signed like your main app). Since this project already handles the signing, I wonder could it bundle in this extra signed app too.
Also, just do you think it's possible to use the approach described in http://martiancraft.com/blog/2015/01/login-items/ ? It seems like it is possible to me but because it requires a user preference I'm not sure how we could toggle it. I assume we'd need some native code to toggle it. So Electron itself would have to expose an API method to us which calls it under the hood? I don't know if there's any other way of toggling this preference any other way like executing a command, etc.
See Teamwork/node-auto-launch#38 (comment) for more background on auto-launch and how this came up.
I wonder could it bundle in this extra signed app too.
👍 PR will be accepted.
I have read linked issue. So, electron-builder should
- bundle helper app, sign and include it on build to packed app.
- PR to electron or some way to enable user pref.
👍 @develar. I assume there's no way to enable the user pref from our main app, even via native modules, although I'm not certain.
@develar This is officially possible, I've detailed the way here: electron/electron#7312 (comment)