How do you set the icon for the Windows executable?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Tybobobo
:warning: Old Version Published before Godot 3 was released.

I am unable to find any option during export to set the icon of the executable file that is generated for Windows. How do I set the icon on export? :slight_smile:

Are there any plans to fix this in the future release?

ligeziak | 2016-04-04 10:52

:bust_in_silhouette: Reply From: The_Duskitty

I believe you just go into Scene>Project Settings And change the Icon property in Application to the image of your choosing

Unfortunately this does not solve the problem. I changed the icon setting at day one working with Godot :slight_smile:

I have tested this with current Steam and latest Github build. Unfortunately, does not work. There have been an issue reported here: Exported custom Application Icon not working · Issue #3852 · godotengine/godot · GitHub

Tybobobo | 2016-03-16 08:40

:bust_in_silhouette: Reply From: Calinou

There is currently no way to change the icon of the Windows export binaries, because pe_bliss (a library we used between 1.1 and 2.0) was removed because of other technical issues it caused (dependency on the libstdc++/vcredist, sometimes breaks with UPX compression).

There is also no way to set metadata on the executables either (pe_bliss could do that).

I’ll also add some info:

It is no use even if we try to use some icon editor on the exe(like reshacker, greenfish icon editor pro), after you swap the icon, the game doesn’t work anymore, guess it has something to do with how the runtime is stored under the exe as the exe goes from 12MB to a little less than 7MB

brunosxs | 2016-04-01 10:44

:bust_in_silhouette: Reply From: wombatstampede

You can change the Icon using an external tool like “Resource Hacker”:
http://www.angusj.com/resourcehacker/

But (!) the new Icon must have the exact format and size of the original icon.

The best tool to achieve this is simply by using gimp.

Export the godot (group) icon using Resource Hacker. Then edit that file with Gimp and replace all resolutions in that icon (they’re in separate layers) by your own icon (resized).

When you export the new icon as ICO in Gimp you should be displayed an export dialogue (when saving) where you can define the exact format of every icon in that ico file. Choose the exact format like in the original godot file (here it was: 32-Bit, 8-Bit Alpha, no compression for every icon).

The new exported icon should now have the original filesize as the godot icon. Now use Resource Hacker to replace the icon.

Resource Hacker allows to uses scripts. So you can automate this process a bit from command line.

Script-File:

[FILENAMES]
Exe=    MyGame.exe
SaveAs= MyGame_ico.exe
Log=    MyGame_ico.log

[COMMANDS]
-addoverwrite MyGame.ico, ICONGROUP,GODOT_ICON,0

The command line/batch:

ResourceHacker.exe -script myscriptfilename.txt

Resource Hacker worked nice for me, however, it doesn’t work if I select the “Embed Pck” option in the export (to have everything in a single file).

Any ideas on how to bypass this?

jeudyx | 2020-04-13 06:02

That ahs worked for me like a charm thanksio sir

Okan Ozdemir | 2020-05-03 05:56