Re: Custom icon for bundle?
Re: Custom icon for bundle?
- Subject: Re: Custom icon for bundle?
- From: Jim Wintermyre <email@hidden>
- Date: Mon, 12 Jun 2006 20:10:57 -0700
At 8:26 PM -0700 6/10/06, Steve Checkoway wrote:
Jim Wintermyre wrote:
This is probably a Stupid Terminal Question (tm), but how do I
figure out what that non-printing character is, and then
incorporate it into my script?
Others answered your other questions, so I won't repeat that. In the
future, if you need to figure out what the character is, I'd just
pipe it through xxd.
$ echo -ne 'Icon\r'|xxd
0000000: 4963 6f6e 0d Icon.
That brings us to the second part, how to incorporate it into your
script. Using the above should work:
file=`echo -ne "/path/to/bundle/blah/Icon\r"`
-n suppresses the newline and -e interprets escapes. I've seen echos
that didn't handle -e (and I can't recall if the BSD one Mac OS X
ships with does) so you could use perl:
$ perl -e "print qq{/path/to/bundle/blah/Icon\r}"
Thanks. Out of all the suggestions, this one turned out to be the
only one that worked for me.
For reference, here's the working script:
# Add custom icon (adding CFBundleIconFile to plist and .icns file in
/Resources doesn't work, so we have to duplicate what happens when
you paste an icon into the Finder Get Info window)
# copy custom icon into top level of bundle and rename to "Icon" with
a *trailing CR*. path_to_icon is the path to the source icon file,
already in the correct format ('icns' resource ID -16455 in resource
fork), but with different filename.
cp <path_to_icon>
"${TARGET_BUILD_DIR}/${PRODUCT_NAME}.${WRAPPER_EXTENSION}/"$(echo -ne
"Icon\r")
# make custom icon file invisible
/Developer/Tools/SetFile -a V
"${TARGET_BUILD_DIR}/${PRODUCT_NAME}.${WRAPPER_EXTENSION}/"$(echo -ne
"Icon\r")
# mark the bundle folder as having a custom icon
/Developer/Tools/SetFile -a C
"${TARGET_BUILD_DIR}/${PRODUCT_NAME}.${WRAPPER_EXTENSION}"
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden