Re: making an installed application run at startup
site_archiver@lists.apple.com Delivered-To: installer-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=ki04MBS2+e9cchcdQgk306pkXiTuhamM1p84iQ+BxKY=; b=mcp/PCT6emW3U/sm1MBE3ngPs2PBnO1emaeo0zNNKXW74sSKOss+0RGm1eb8tHstTH zWGPg+iqzsJZIKUP65DMQvlacqWIRPd3xcFoqFCtvag6Oc3Yj4W4xx2r9H7oni6oGmtx CF/4tjkln017yE72puQ1U9jF9Balf7QisrJJo= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=rl5aNZzY38YE8v+Nxm0zDNGuWE1dAifq+8FQpX5lgI83Orkcjg3ARJ6CRmCoxJI5dz 3y1DCBWqhewxJIvZkTbWyr6l57pqoygn4ht9BLS00/yA27c7M94piFv2yCM6fxR1wea/ QSpfGPhON2yPvYkg5gl0Xf8jRbKsIRTZnoybg= On Jan 13, 2009, at 2:02 PM, Jason Proctor wrote: btw, just found a simple way by googling around -- -- Karl Kuehn larkost@softhome.net _______________________________________________ Do not post admin requests to the list. They will be ignored. Installer-dev mailing list (Installer-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/installer-dev/site_archiver%40lists.a... /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. This email sent to site_archiver@lists.apple.com
participants (1)
-
Karl Kuehn