Am 05.07.2012 um 17:39 schrieb Philippe GUEDJ :

> I'ts not totally clear for me, I don't understand the notion of Main and 
> Helper apps..


maybe this helps:



Below you find the documentation from Apple and link to original pages.
Our plugin implements the SMLoginItemSetEnabled function in the 
ServiceManagementModuleMBS module.
Also we have the register method to register the helper app with Launch 
Services.

Our plugins also implement LoginItemsMBS class for the older Mac OS X versions 
and where Apple Events are preferred (outside sandbox).

MBS Documentation:
http://www.monkeybreadsoftware.net/module-servicemanagementmodulembs.shtml



from Apple Documentation:


Adding Login Items

There are two ways to add a login item: using the Service Management framework, 
and using a shared file list

Login items installed using the Service Management framework are not visible in 
System Preferences and can only be removed by the application that installed 
them.

Login items installed using a shared file list are visible in System 
Preferences; users have direct control over them. If you use this API, your 
login item can be disabled by the user, so any other application that 
communicates with it it should have reasonable fallback behavior in case the 
login item is disabled.

Adding Login Items Using the Service Management Framework

Applications can contain a helper application as a full application bundle, 
stored inside the main application bundle in the Contents/Library/LoginItems 
directory. Set either the LSUIElement or LSBackgroundOnly key in the Info.plist 
file of the helper application’s bundle.

Use the SMLoginItemSetEnabled function (available in Mac OS X v10.6.6 and 
later) to enable a helper application. It takes two arguments, a CFStringRef 
containing the bundle identifier of the helper application, and a Boolean 
specifying the desired state. Pass true to start the helper application 
immediately and indicate that it should be started every time the user logs in. 
Pass false to terminate the helper application and indicate that it should no 
longer be launched when the user logs in. This function returns true if the 
requested change has taken effect; otherwise, it returns false. This function 
can be used to manage any number of helper applications.

If multiple applications (for example, several applications from the same 
company) contain a helper application with the same bundle identifier, only the 
one with the greatest bundle version number is launched. Any of the 
applications that contain a copy of the helper application can enable and 
disable it.

Adding Login Items Using a Shared File List

This method is available in Mac OS X v10.5 and later. For specific details, see 
the appropriate functions in Launch Services Reference.

Deprecated APIs

In previous versions of Mac OS X, it is possible to add login items by sending 
an Apple event, by using the CFPreferences API, and by manually editing a 
property list file. These approaches are deprecated.

If you need to maintain compatibility with versions of Mac OS X prior to v10.5, 
the preferred approach is to use Apple events; for details, see LoginItemsAE. 
Using the CFPreferences API is an acceptable alternative. You should not 
directly edit the property list file on any version of Mac OS X.





Apple Documentation:
https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLoginItems.html#//apple_ref/doc/uid/10000172i-SW5-SW1




Greetings
Christian

-- 
Real Studio Conferences, Training and Meetings.

More details and registration here:
http://www.monkeybreadsoftware.de/realbasic/events/





_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Reply via email to