Re: launching application after reboot
Re: launching application after reboot
- Subject: Re: launching application after reboot
- From: Jean-Daniel Dupas <email@hidden>
- Date: Thu, 17 Dec 2009 20:43:24 +0100
Le 17 déc. 2009 à 20:24, Jens Alfke a écrit :
>
> On Dec 17, 2009, at 10:26 AM, Kyle Sluder wrote:
>
>> Why?! If the user wants to start your program, they will start your program.
>
> It could be necessary for some sort of installer that needs to restart the OS and then needs to run something afterwards. (Some of Apple's firmware updaters do this.) But yeah, I can think of very few cases where it would be needed...
>
>> If you have a good reason for this, please read System Startup
>> Programming Topics in the documentation:
>> http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPSystemStartup/BPSystemStartup.html
>
> Um, he said "run an _application_". That's not the appropriate documentation for that.
>
> The right thing to do is to add the app as a login item, and then when the app launches, have it remove itself. (Is there an official API yet for manipulating login items, or do you still have to mess with a .plist?)
There is since 10.5. The Shared File List API in Launch Services. Search the headers for documentation and have a look at System Startup Programming Topics (in Customizing Login and Logout)
But it will be rather fragile. I know that the user will usually relog using the same account, but it may not be the case.
-- Jean-Daniel
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden