Forum > macOS / Mac OS X

How to add Application Icon?

(1/2) > >>

abb:
Hi, All,

Not most important aspect though, but yet interesting -- how to add the icon to show it in Finder for .APP format, created for an executable, created with Lazarus? Should it be added to the executable itself or should be it placed somewhere within .APP directory?

Thanks.

Marc:
Not yet implemented, maybe it can be done with the Info.plist inside the .app dir

Phil:

--- Quote from: "abb" ---Should it be added to the executable itself or should be it placed somewhere within .APP directory?
--- End quote ---


Everything the executable needs goes in the .app bundle. This includes the icon (32x32) file, help files, localized strings, any "private" libraries or frameworks, etc. It sounds like you haven't discovered this:

http://developer.apple.com/documentation/MacOSX/

abb:

--- Quote from: "Phil" ---Everything the executable needs goes in the .app bundle. This includes the icon (32x32) file,......
--- End quote ---

OK, but why 32x32 size only? AFAIK icns supports multisized icons.

--- Quote from: "Phil" ---
http://developer.apple.com/documentation/MacOSX/
--- End quote ---

I've found a .plist specification, where there is icon definition. I've downloaded Iconographer and have created icns file, and I've tried to add it into the APP Resourses/ folder and modified the plist file.... no luck.
Here is a part of my .plist file:

--- Code: ---  <key>CFBundleIconFile</key>
  <string>monitor</string>
--- End code ---

monitor.icns is placed into Resourses/ subdirectory, but there is no effect.
I tried to include the ".icns" file extention here -- no luck. I've read that I need to logout/login to see APP changes, I tried it but with the same result.

What I'm doing wrong?

Phil:

--- Quote from: "abb" ---
OK, but why 32x32 size only? AFAIK icns supports multisized icons.

I've found a .plist specification, where there is icon definition. I've downloaded Iconographer and have created icns file, and I've tried to add it into the APP Resourses/ folder and modified the plist file.... no luck.
Here is a part of my .plist file:

--- Code: ---  <key>CFBundleIconFile</key>
  <string>monitor</string>
--- End code ---

monitor.icns is placed into Resourses/ subdirectory, but there is no effect.
I tried to include the ".icns" file extention here -- no luck. I've read that I need to logout/login to see APP changes, I tried it but with the same result.

What I'm doing wrong?
--- End quote ---


Ideally you would have a 128 x 128 icon. Finder will scale it down for lower resolutions if needed. However, if you're moving an icon over from Delphi it will be 32 x 32. This can be scaled up to 128 x 128 and still looks fairly good.

Why aren't you using OS X's Icon Composer?

I would include the icon file's extension in the Info.plist.

Finder appears to be a bit weird sometimes about "refreshing" the icon for an .app when you change the icon. Try dragging the app to a different folder and see if that works. I've also read that logging out works. You could also try relaunching Finder (Esc-Option-Apple keys).

When you install the app on your users' computers you won't have this problem since they've never had the app with the default icon that Finder used for your app originally.

Navigation

[0] Message Index

[#] Next page

Go to full version