Windows icon odd behavior [solved]

i’ve built my game using a custom icon (using the sizes 256,128,96,80,72,64,60,48,40,36,32,30,24,20,16) (though only 256,128,96,64,48,32,24,16 are actually packaged in the exe)
when launching the game from the bundled executable, the icon is properly set, and appears fine in the task bar, title, and alt tabbing and ect., however, when built from the editor, the icon is not created and falls back the the standard defold icon.
additionally, the executable file does not show the icon in the file explorer when in compact list mode, but does show the icon on the desktop, and when the display mode of the file explorer is in a grid display or a larger list display mode
why is this happening?
some images displaying when it does not show the correct icon
Capture1
compact list mode

Capture2
list mode

Capture3
application title

Capture4
grid display

This is the expected behaviour. When you do Project->Build / CTRL+B from the editor we do not create an application bundle (ie Project->Bundle->Windows) and will not generate an icon.

My guess is that an icon size is missing. Which tool are you using to create the .ico file and which sizes are included in the file?

1 Like

i’m using GIMP
see here for the sizes (they’re square):

(using the sizes 256,128,96,80,72,64,60,48,40,36,32,30,24,20,16) (though only 256,128,96,64,48,32,24,16 are actually packaged in the exe)

i’m saving each icon size as uncompressed 32 bpp, no pallete

The first part has been answered by @britzl.
Speaking of the icon behaviour on Windows explorer, your problem happens either because of missing sizes or because of how Windows renders from the icon cache in different display modes. To confirm that it’s the latter situation, you can move the bundle folder somewhere else and check. To solve it, run this batch file to clear the icons cache and restart the explorer.
Also, use this tool I made recently to ensure that the correct format and sizes are included instead of exporting different sizes separately.

5 Likes

yeah, i’m pretty sure it’s the cache that’s doing it.
thanks!

1 Like

I have a brand new installation of Windows 11, but cleared the icon cache anyway - and the ico file I made in Gimp started to work for all view modes. Before, the larger views fell back to the Defold icon no matter what sizes I used to produce the ico file.
So - thank you very much for the hint with the icon cache!

2 Likes