Re: How to add a URL-tile to the Dock from an Installer?
Re: How to add a URL-tile to the Dock from an Installer?
- Subject: Re: How to add a URL-tile to the Dock from an Installer?
- From: Jay Koutavas <email@hidden>
- Date: Fri, 31 Dec 2004 09:12:19 -0500
When I look at the permissions on the com.apple.dock.plist after
install, they are the same as before the install. I see:
-rw------- 1 jay jay 14715 31 Dec 09:10 com.apple.dock.plist
Doing a 'chmod 0777' from the shell script (opened the permissions
wide) also had no effect.
/Jay
At 7:42 AM -0500 on 12/31/04, Darkshadow wrote:
The problem is that the file is getting owned by root, and since
*.plist files are only rw for the owner, the user's dock can't
access its preferences anymore and so starts up with the default
preferences.
You'll need to either set the owner back, or change the permissions
so that everyone can read/write. I'd choose the former.
Err, and if it helps, the scripts that are run don't actually *have*
to be scripts - you can make a small tool to do the job. The
installer will run anything that's executable.
Hope that helps,
Darkshadow (aka Michael Nickerson)
On Dec 30, 2004, at 8:10 PM, Jay Koutavas wrote:
My product requirements are asking me to "Add two URL item-thingies
to the Dock on product install" (paraphrased. :))
Reading through the cocoa-dev archive, there seems to be consensus
along the lines of "One shouldn't force something onto the Dock,
it's up to the user to define." Which I'm in agreement with too,
one should prompt the user for that. So, my Installer will do the
right thing and prompt first.
Now, getting down to the engineering business of modifying a live
running Dock, I first wrote the following shell script to do an
addition of a URL tile to the Dock. (A URL tiles are those shiny
metal '@' icons with a spring attached, seen on the right-hand side
of the Dock).
The script works great when executed from the command line, though
naturally the hard-coded user path needs to scoot. Here's the
script:
----
#!/bin/bash
defaults write /Users/jay/Library/Preferences/com.apple.dock
persistent-others -array-add
'<dict><key>tile-data</key><dict><key>label</key><string>http://www.heynow.com</string><key>url</key><dict><key>_CFURLString</key><string>http://www.heynow.com</string><key>_CFURLStringType</key><integer>15</integer></dict></dict><key>tile-type</key><string>url-tile</string></dict>'
killall -HUP Dock
----
The problem I'm running into is when I try to use the above within
my PackageMaker's postinstall script. What occurs is the entire
com.apple.dock.plist file gets reset to the factory default.
My postinstall script must be silently failing somehow (no mention
of an error in Console or the Install log) clobbering the
com.apple.plist and that the Dock, on restart wants to fallback to
its factory default com.apple.dock.plist as a recovery scheme. Any
suggestions on what to do? Any explanation of what my postinstall
shell script is doing wrong?
I realize that this post is a bit off topic for Cocoa-dev, but
there has been some discussion of programmatically tweaking the
Dock previously on this list. Nonetheless, suggestions on where to
cross-post are also welcome.
Happy New Year
/Jay
--
Attachment converted: boot:smime 262.p7s ( / ) (000A13C4)
--
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Jay Koutavas mailto:email@hidden
Heynow Software http://www.heynow.com
Windham, New Hampshire, USA
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden