Add/remove .app file to startup programatically

Discussion in 'Mac Programming' started by developer.in, Dec 19, 2008.

  1. developer.in macrumors newbie

    Joined:
    Nov 5, 2008
    #1
    Hi

    In my mac application I want to give the user an option of starting the app on startup in application preferences.
    How can I add or remove my application to startup programs programatically?
    I am using Objective-C as the programming language.

    Thanks
     
  2. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #2
    Startup as in /Library/StartupItems/?
    or
    Startup as in the user's Login Items?
     
  3. developer.in thread starter macrumors newbie

    Joined:
    Nov 5, 2008
    #3
    As in user's Login items.
     
  4. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #4
    Not sure about programmatically, but here's what I use for AD attached Macs that won't open Login Items appropriately on cached credentials. Maybe it'll lead you in the right direction:

     
  5. developer.in thread starter macrumors newbie

    Joined:
    Nov 5, 2008
    #5
    Thanks. That did help. But is there any way I can open it as a source code file like we open a normal info.plist? Shows some garbled values when I tried. I wanted to see the the format.
     
  6. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #6
    Ah, plists were converted to binary files in Tiger (I think), where they were flat text before that.

    plutil can be used to convert from bin/xml.
     
  7. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
  8. satyam90 macrumors regular

    satyam90

    Joined:
    Jul 30, 2007
    Location:
    Bangalore, India
    #8
    I tried a lot with UKLoginRegistry on Mac Tiger. But didn't work. The same thing if I debug line by line it is working. When I run as an application its not working.
     

Share This Page