In UE4, I set the “Game Icon” to my custom icon in Project Settings, and if I build from UE4 my application correctly receives this icon. However, when I build using windows command line tools (UnrealBuildTool.exe, RunUAT.bat BuildCookRun), it defaulst to the UE4 icon. The icon “WindowsNoEditor/[project_name].exe” is correctly my custom icon, but “WindowsNoEditor/[project_name]/Binaries/Win64/[project_name]-Win64-Shipping.exe” is the UE4 icon, which is what is used for the task bar and the window icon. There are a lot of answer hub topics on this, but none that address this issue in particular. Does anyone know a fix? Is anyone successfully setting an icon when using command line build tools?
edit I posted a solution down below, but its not marked as the answer because its a hack. But if you have a need to fix this issue, and don’t want to go looking in UE4 code for the problem, its a quick fix.
I have tried that method. To reiterate, the issue appears to be that somewhere in the command line build tools (vs the in-editor build tools), it misses the “Binaries/Win64/[project_name]-Win64-Shipping.exe” and doesn’t assign it my custom icon, though it assigns it fine for “[project_name].exe”.
I ended up solving this by using Resource Hacker, a tool that can change icons of executables. It can be invoked via command line, which I do in my build automation process. I won’t mark this as answer because its more of a hack.
This works for me… PARTIALLY. The taskbar icon looks right, but the exe is a generic icon.
This has to be the single most frustrating part of development with UE. I cannot believe that this problem still exists after 8 years!!! WHAT THE HELL UNREAL???
as of Unreal Engine 5.6, building with BuildCookRun (in my experience) still doesn’t properly set the icon. it does for the main .exe, but not for UnrealGame-Win64-Shipping.exe, which causes the unreal engine icon to appear in the taskbar and titlebar icons for your game.
right now, the only solution is still using resource hacker to manually change the icon of UnrealGame-Win64-Shipping.exe inside Engine/Binaries/Win64 (or whatever platform you’re building to).
i am using CreateUatTask for this, so that very well may be the root cause.