sindresorhus / LaunchAtLogin-Legacy

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

Make LaunchAtLogin get correctly notarized by Apple when building with configurations named other than `Release` #52

Closed rameerez closed 3 years ago

rameerez commented 3 years ago

LaunchAtLogin made the assumption that production releases were built using a configuration named Release, but it's often helpful to use other configuration names, like Release-MAS. This prevented the copy helper script from removing the LaunchAtLogin_LaunchAtLogin.bundle on such releases, making the notarization process fail.

Made the script remove the bundle on all builds except those using a configuration named explicitly Debug and added the new assumption to the Readme FAQ.

This should fix #50.

sindresorhus commented 3 years ago

I wonder if it's possible to detect if the current configuration is "release build type" without matching on the name.

Any thoughts on this? (From the issue). Would be a much better solution if possible.

zackdotcomputer commented 3 years ago

Hello! I just ran into #50 as well after making a separate "Not App Store" release config for notarized distribution. Hoping we might be able to get this fixed up and merged...

Looking into the question @sindresorhus asked above about whether there was a way to switch on "debug vs. release" other than by name matching the build config, I dumped the ENV variables for release, debug, and a custom debug scheme and I think the best solution would be to use the $GCC_PREPROCESSOR_DEFINITIONS value which appears to include DEBUG=1 whenever the build config is based on the default debug config (unless the developer has turned off Debug preprocessing for some reason).

There's also the $ONLY_ACTIVE_ARCH flag which will be YES for debug builds that are targeting a single arch and NO for release builds meant to be copied and distributed. That might be a bit more reliable though I'm not enough of a GCC expert to say 100% whether there are edge cases with this flag.

zackdotcomputer commented 3 years ago

I guess it's good form to do your own PR rather than drive-by'ing someone else's. Will spin one up based on this one.

sindresorhus commented 3 years ago

Closing in favor of #57