I compile a Mac OSX bundle, called MyBundle.bundle, which is used as a plugin for another application. I want the bundle have a unique icon and so I set the Info.plist file to say:
<key>CFBundleIconFile</key>
<string>MyIcon.icns</string>
and place the file MyIcon.icns in the bundle's MyBundle.bundle/Contents/Resources folder.
This does not work, the finder show a generic icon for the bundle and ignores the specified MyIcon.icns file. If I change the bundle's extension from .bundle to .app the icon immediately shows - so I know the Info.plist is correct.
I found a work around that simulates a user doing copy and paste of an icon on the bundle:
I add the icon as a resource of type "icns" and id -16455 to the bundle's .rsrc file.
I than call
/Developer/Tools/SetFile -a BC MyBundle.bundle
This works, but is really lame. Starting in Mac OS 10.8 SetFile takes forever to execute.
My question: Is there away to force the Finder to show the bundle's icon without such hacks?
BTW: There is a question on same subject: Set icon of non app mac os x bundle; but the only answer there instructs on how to create an icon, and does not help with the problem.