Re: PackageMaker & Custom Folder Icons
Re: PackageMaker & Custom Folder Icons
- Subject: Re: PackageMaker & Custom Folder Icons
- From: Paul Cook <email@hidden>
- Date: Thu, 27 Mar 2008 16:22:49 -0500
Thank you very much. Some of this is new, so it may take me a while
to figure it out. But, I do expect that I and others will find it
useful.
Best Wishes,
Paul
On Mar 27, 2008, at 12:07 PM, Andrew wrote:
Paul,
I'd prefer not to spread my contact information, but feel free to
share the information part of this email with the list if you find
it useful.
Our installers do three things to get custom folder icons to appear
properly in a variety of OS versions:
1. Install an Icon^M file (same as Icon\r as Stephen indicates).
In bash, you can form this file name using Icon$'\r' or "$
{SOME_PARENT}"/Icon$'\r'
2. Set the custom icon bit on the enclosing folder. We do this by
"find"ing Icon^M files in our installation and then running a
custom tool on the parent directory paths. Depending on your
scripting ability and environment, it may be simpler to just use a
fixed path. You could test this step using the developer tool
SetFile, however, I would be surprised if you could ship with that.
3. Refresh the Finder's view of the folder. Historically we have
done this via an AppleScript that tells the Finder to iterate all
its windows and update the items of each one. More recently we
have had success asking the Finder to update all the parent
directory paths up to and including the one getting the custom
icon. There are other gyrations such as deleting or
replacing .DS_Store files and restarting the Finder that can be
done, however, the above approaches work pretty reliably and have
the benefit of not losing data such as window layouts.
Best of luck,
Andrew
On Mar 27, 2008, at 7:21 AM, Paul Cook wrote:
Stéphane Sudre,
Thanks very much for the needed refresher course & your help.
In answer to your question, we were observing this issue on
Leopard 10.5.2. Leopard 10.5.2 was used to create the packages and
it was also the target.
I'll try to see if the "kHasCustomIcon" is being set on the
folder. That sounds like a good lead.
Best Wishes,
Paul
On which OS are you observing this issue?
Custom Folder icons has a troubled history with Installer.app and
Mac OS X.
o First, a refresher on custom folder icons:
To have a custom folder icon you need to have both an invisible
Icon \r file inside the folder and some flags set on the folder
itself.
* Icon\r file
It is a Resource fork file. The different icon representations
are stored in 'icns' resource -16455. The file type is 'icon',
the creator is 'MACS'. The FileInfo finderFlags for this file has
the kIsInvisible flag set
* Folder:
The FolderInfo finderFlags for the folder has the kHasCustomIcon
flag set.
o This means that in order to have a custom folder icon, a
package needs to both retain the resource fork of the Icon\r file
and the Finder flags.
This is done through the split forks operation that creates the
Apple Double format file. A file A may end up through this
process as 2 files:
A which only contains the data fork part of A
._A which contains the finder Info and the resource fork of A
I filed a bug report (Problem ID: 3635123 04/27/2004 which is
said to be a duplicate of 3551477). At the time, the issue was
that the kHasCustomIcon was not set back on the folder upon
installation.
I can't say whether the bug was fixed or not on the OS I was
observing it because the report was marked as duplicate.
My $0.02
--
Stephane
On Mar 26, 2008, at 3:38 PM, Paul Cook wrote:
Does anyone know how to get Apple's PackageMaker to handle
custom folder icons?
I'm not really a developer. But in order to install software via
Apple Remote Desktop or as part of OS-X Servers NetInstall, it
has to be in an Apple style package. So we are repackaging some
software with PackageMaker. And this seems to be the most
appropriate list for PackageMaker questions.
Generally, things are working well, except that, when we run the
installers, folders have lost their custom icons. Otherwise, if
there are other problems, we haven't yet noticed them.
One example is, we were trying to repackage Office 2004 into a
package so that it could be installed by Leopard Server's
NetInstall feature. Other than being big, there doesn't appear
to be anything too complicated here. The created install works
fine, except the Office 2004 folder icon is missing. Although,
if I do an ls -Gal of the folder created with the installer,
there is a .Icon file there.
Since Office is so huge, to make testing quicker, we created a
new, folder with just a simple text file in it and using
finder's Get Info, we copied the icon from the original Office
2004 folder and pasted it into the test folder. It seems to
recreate the problem fine. The package creates a the folder, as
it should, except no custom icon displays.
I'm using the Leopard Developer Utilities on a Mac running the
current version of Leopard.
Based on some google hits for the problem, I've played with
trying to not filter out the .DS_Store files. We've tried
playing with what is the root for the package. And we put the
source for Package Maker onto a UFS disk image to force any
resources into Apple Double format. (One hit suggested that
PackageMaker didn't properly handle resource forks. Is true?) We
have also looked at what Apple documentation we could find on
how to use PackageMaker.
We didn't want to let a little think like an Icon be a blemish
on the quality of the effort, but after about 5 hours on this
little icon problem, we decided to take a break.
Any ideas?
Best Wishes,
Paul
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40comcast.net
This email sent to 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:
40adobe.com
This email sent to 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