Re: Remove old startup item
Re: Remove old startup item
- Subject: Re: Remove old startup item
- From: Stephane Sudre <email@hidden>
- Date: Tue, 22 Jan 2013 10:34:48 +0100
On Tue, Jan 22, 2013 at 12:55 AM, Andrew Keller <email@hidden> wrote:
> Hello, all,
>
> In previous versions of my app, the installer added the app to the system-wide per-user login items list (/Library/Preferences/loginwindow.plist). The app was converted to use launchd a while ago, but installations of the old version are still floating around, so I would like to modify the current installer to be able to remove the old login item.
>
> It looks like `defaults` could be used to make the necessary modifications, but the man page says that its behavior regarding non-preferences files is likely to change in the future.
>
> Before the app used launchd, it used CoreFoundation to read the file, insert a new entry, and save the file. Theoretically, the same technique could be used to remove the login item.
>
> It would be nice to simply add a few lines to the postinstall script in the installer package, but if it would be more reliable to write a CoreFoundation tool, I can do that instead.
>
> Any suggestions?
LSSharedFileList.h is probably your new best friend
(LaunchServices.framework) for the CF tool (I would say it's cleaner
and safer to write the CoreFoundation tool and invoke it from the
postinstall script).
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden