• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: making an installed application run at startup
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: making an installed application run at startup


  • Subject: Re: making an installed application run at startup
  • From: Karl Kuehn <email@hidden>
  • Date: Tue, 13 Jan 2009 16:09:06 -0800

On Jan 13, 2009, at 2:02 PM, Jason Proctor wrote:

btw, just found a simple way by googling around --

/usr/bin/osascript -e "tell application \"System Events\" to make new login item with properties { path: \"/Applications/YourApp.app \", hidden:false } at end"

seems to work, though there is some jiggerypokery required with the quotes to make the shell happy with it.

I would be really careful about doing things like this. There are three reasons for this:


1) The applications is being installed via Apple Remote Desktop. In that case the user who is at the console may not have any idea that the application is being installed. And there is a good chance that there might be no-one logged in at the time, so this is not going to work (most AppleScript does not work when at the loginwindow)

2) The computer may have more than one account, and so you are not necessarily working on the correct account.

3) Your installer might be running inside InstaDMG or Apple's SUI, both of which run on target volumes. So in the case of InstaDMG your installer would put files in one place, but then make the startup item on another volume completely.

I also strongly dislike things that decide without my input that they need to run at startup. It is practice that happens all the time on Windows, and seriously degrades performance.

In my mind a much better solution if you have to run at login is to ask the user if they would like that behavior on first launch. If you absolutely have to have it, then you probably should look into writing yourself into /Library/Preferences/loginwindow.plist, namely inside the AutoLaunchedApplicationDictionary item (it should be an array). It you can't justify putting yourself in that file, then you should not have your installer do this.

--
		Karl Kuehn
			email@hidden



_______________________________________________
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


  • Follow-Ups:
    • Re: making an installed application run at startup
      • From: Jason Proctor <email@hidden>
References: 
 >Re: making an installed application run at startup (From: Jason Proctor <email@hidden>)

  • Prev by Date: Re: making an installed application run at startup
  • Next by Date: Re: making an installed application run at startup
  • Previous by thread: Re: making an installed application run at startup
  • Next by thread: Re: making an installed application run at startup
  • Index(es):
    • Date
    • Thread