sindresorhus / LaunchAtLogin-Legacy

Add “Launch at Login” functionality to your macOS app in seconds
MIT License
1.55k stars 122 forks source link

Use new `SMAppService` for macOS 13 #76

Closed sindresorhus closed 1 year ago

sindresorhus commented 2 years ago

Apple finally answered my prayers!

We finally don't need a useless helper app 🎉

Docs: https://developer.apple.com/documentation/servicemanagement/smappservice/3945412-mainapp?changes=latest_minor

We need to check the old property too: https://developer.apple.com/documentation/servicemanagement/smappservice/4024717-statusforlegacyplist?changes=latest_minor


We need some migration step. My plan is to add a LaunchAtLogin.migrate() method. It would check if the old launch at login is enabled, if so, it would set the modern one to be enabled too, and then disable the old one.

Use UserDefaults to ensure the migration is only called once.