[SOLVED] Icons & rdef

I’m experimenting with ressource file (.rdef) and there’s something I’m not sure about.

First I’m compiling a “rdef” file which contains an icon:
rc -o app.rsrc app.rdef

Then I attach the ressource file to the binary:
xres -o /boot/home/Desktop/Attrify ./app.rsrc

When checking Addons>FileType, I can see the Icon which is fine :

However on the Desktop, no icon is visible.

Should I add to the binary (in addition to the ressource file) a BEOS:ICON attribute ?

I think there’s something I’m missing because this will be redundant.

I wish QuickRes existed for 64bit Haiku.

Did you force Tracker to identify again the file?

As this app file was already identified previously, and without a custom icon, Tracker get from MIME db the default “app” icon.

If a custom icon was present in the app binary ressources, it will have detect it at this time and set the file BEOS:ICON attribute accordingly.

But, IIRC, it doesn’t do automatically another detection just when the binary file content changed. Forcing a Identify is, from my memory, necessary

Normally, interacting with the executable in Tracker, like right-clicking, should identify it and have it show the custom icon.
Or you could do a mimeset -f Attrify.

I noticed that the executable was read only.
Putting the +w permission rights solved the issue :slight_smile:

1 Like

An additional question on that topic:
If my application is using a resources file to have the version, signature and icon, what is the aim to have also these information duplicated in the attributes of the application ?
I imagine it’s relative to the possibility to query these information via attributes (whereas it’s not possible for resources attached to the file)

EDIT: If I understood correctly, the first step is to have the resource file, then the system is using this resource file to propagate it into attributes (for the Tracker, etc). So it means the golden source is the resources file for such information.

Ressources needs the file to be an ELF file. So not all kind of files could have ressources.

Meanwhile attributes needs the file system to supports attributes, but any kind of files could, then, have attributes. Even directories, in fact.

BeFS is optimized to place along the traditional node info the first attributes data, making retrieving them in one block read possible (and compact HVIF format helps a lot here to make the custom icon being there), while ressources, when file is an ELF file, needs accessing not just the file node info block but also the file content, and a far more complex parsing of that data.

Ressources are more about executable programs structured assets.