Hi Simon,
The safest way to change the name of the executable that UnrealBuildTool generates is to rename the project. Thankfully, in the latest UE versions, this should be straightforward as noted in [this short [Content removed]
When you package through the Editor UI, UBT generates the decorated “MyGame-Win64-Shipping.exe” as the main executable, but the staging phase also generates an undecorated bootstrapper “MyGame.exe”, which should serve as the top-level executable for your users. You can also rename the bootstrapper as desired, either manually or through some other script.
Note that it is possible to instruct UnrealBuildTool to generate a custom-named main executable, but this does not generally play well with staging and other packaging phases as triggered from the Editor UI. If you want to try it, you can edit your .Target.cs file and include the following line inside the class constructor:
Name = "MyCustomName";Finally, if you’d like to dive straight into the source code, the binary filename is generated at the end of the following call chain (but note that other build products also go through it):
UnrealBuildTool.UEBuildTarget.PreBuildSetup(Microsoft.Extensions.Logging.ILogger Logger) Line 4460
UnrealBuildTool.UEBuildTarget.SetupBinaries(Microsoft.Extensions.Logging.ILogger Logger) Line 6085
UnrealBuildTool.UEBuildTarget.MakeBinaryPaths(EpicGames.Core.DirectoryReference BaseDirectory, string BinaryName, UnrealBuildTool.UnrealTargetPlatform Platform, UnrealBuildTool.UnrealTargetConfiguration Configuration, UnrealBuildTool.UEBuildBinaryType BinaryType, UnrealBuildTool.UnrealArchitectures Architectures, UnrealBuildTool.UnrealTargetConfiguration UndecoratedConfiguration, string ExeSubFolder, EpicGames.Core.FileReference ProjectFile, UnrealBuildTool.ReadOnlyTargetRules Rules) Line 5491
UnrealBuildTool.UEBuildTarget.MakeBinaryFileName(string BinaryName, string Separator, UnrealBuildTool.UnrealTargetPlatform Platform, UnrealBuildTool.UnrealTargetConfiguration Configuration, UnrealBuildTool.UnrealArchitectures Architectures, UnrealBuildTool.UnrealTargetConfiguration UndecoratedConfiguration, UnrealBuildTool.UEBuildBinaryType BinaryType) Line 5438
I hope this is helpful. Let me know if one of these solutions works for you and if there is anything else I can assist you with.
Best regards,
Vitor