@Override
public boolean register(final Application application) {
final Local helper = new FinderLocal(new BundleApplicationResourcesFinder().find().getParent(),
String.format("Library/LoginItems/%s.app", application.getName()));
if(!finder.register(helper)) {
log.warn(String.format("Failed to register %s (%s) with launch services", helper,
finder.getDescription(application.getIdentifier())));
}
if(!ServiceManagementLibrary.SMLoginItemSetEnabled(application.getIdentifier(), true)) {
log.warn(String.format("Failed to register %s as login item", application));
return false;
}
return true;
}