IconComposer option in Projucer breaks document/file type icons on macOS

Hi all,

It seems that using the new IconComposer icons via Projucer breaks support for Finder icons for any registered document file types… they fall back to the generic blank icon.

Cause: the generated Info.plist seems to hardcode CFBundleTypeIconFile to Icon, but the IconComposer path now names the actual resource after the app icon name (e.g. MyAppIcon.icns), so the reference points at a file that no longer exists.

Could the exporter be updated to use the correct filename when IconComposer is enabled (or just hard-code “Icon” always)?

Possible source code causing issue

In extras/Build/juce_build_tools/utils/juce_PlistOptions.cpp there is the hard-coding of “Icon”:

addPlistDictionaryKey (*dict2, "CFBundleTypeIconFile", "Icon");

and I think a counterpart problem line is in extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h where the app icon name is used:

iconFile = getTargetFolder().getChildFile (getAppIconNameOrElse ("AppIcon") + ".icns");
build_tools::writeMacIcon (icons, iconFile);

Thanks,

Adam

p.s. The Projucer also seems to have this problem on my machine as I don’t see icons for my .jucer files. You can see the Projucer icns file is…

/Applications/Projucer.app/Contents/Resources/AppIcon.icns

but the plist says…

<key>CFBundleTypeIconFile</key>
<string>Icon</string>
1 Like