Hi,
I have an assistant that launches using a LaunchAgent and a conditional file path.
The problem is during Setup Assistant sessions (after a macOS update for example) my app launches before the user logs in.
This is due to the Setup Assistant starting a session under Setup User.
Is there a smart/clean way to avoid the agent launching in this situation ?
Visibly launchd configuration files cannot help here. The only solution I see is checking the current user on app launch and abort if it's _mbsetupuser - and this solutions isn't clean at all. I'm not even sure it is possible under sandboxing.
Any Help ?
Regards,
Jerome
Thanks for that.
In your situation I’d change your launchd property list to point to a custom tool rather than
/usr/bin/open, and then have that decide whether to launch Corp Assistant based on the current user.
Keep in mind that you’ll want this custom tool to not exit immediately once it’s launched Corp Assistant, but start its own monitoring of
~/Library/Preferences/.CorpAssistantDone and stick around until that’s set. If it exits immediately then
launchd is just going to relaunch it, which is not what you want.
Once you do that you can get rid of your override of
ThrottleInterval, which is a bit weird.
Earlier you wrote:
The only solution I see is checking the current user on app launch and abort if it's
- and this solutions isn't clean at all._mbsetupuser
I’m not sure why you think that’s not a ‘clean’ solution.
I'm not even sure it is possible under sandboxing.
That should work just fine.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"