From 6dfd8223909ce2d2237701ba98f9230f895df3ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?= <7645683+bruvzg@users.noreply.github.com> Date: Tue, 28 Oct 2025 12:11:07 +0200 Subject: [PATCH] [Windows] Use separate resource files for export templates. --- platform/windows/SCsub | 16 +++++++++--- platform/windows/godot_res_template.rc | 28 +++++++++++++++++++++ platform/windows/godot_res_wrap_template.rc | 28 +++++++++++++++++++++ 3 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 platform/windows/godot_res_template.rc create mode 100644 platform/windows/godot_res_wrap_template.rc diff --git a/platform/windows/SCsub b/platform/windows/SCsub index 181b3a09c89f..aefb04818a0a 100644 --- a/platform/windows/SCsub +++ b/platform/windows/SCsub @@ -69,8 +69,12 @@ def arrange_program_clean(prog): env["BUILDERS"]["RES"].emitter = redirect_emitter -res_file = "godot_res.rc" -res_target = "godot_res" + env["OBJSUFFIX"] +if env.editor_build: + res_file = "godot_res.rc" + res_target = "godot_res" + env["OBJSUFFIX"] +else: + res_file = "godot_res_template.rc" + res_target = "godot_res_template" + env["OBJSUFFIX"] res_obj = env.RES(res_target, res_file) env.Depends(res_obj, "#core/version_generated.gen.h") @@ -94,8 +98,12 @@ if env.msvc: # Build console wrapper app. if env["windows_subsystem"] == "gui": - res_wrap_file = "godot_res_wrap.rc" - res_wrap_target = "godot_res_wrap" + env["OBJSUFFIX"] + if env.editor_build: + res_wrap_file = "godot_res_wrap.rc" + res_wrap_target = "godot_res_wrap" + env["OBJSUFFIX"] + else: + res_wrap_file = "godot_res_wrap_template.rc" + res_wrap_target = "godot_res_wrap_template" + env["OBJSUFFIX"] res_wrap_obj = env_wrap.RES(res_wrap_target, res_wrap_file) env_wrap.Depends(res_wrap_obj, "#core/version_generated.gen.h") diff --git a/platform/windows/godot_res_template.rc b/platform/windows/godot_res_template.rc new file mode 100644 index 000000000000..bdcd1de85063 --- /dev/null +++ b/platform/windows/godot_res_template.rc @@ -0,0 +1,28 @@ +#include "core/version.h" + +#ifndef RT_MANIFEST +#define RT_MANIFEST 24 +#endif + +GODOT_ICON ICON platform/windows/godot.ico +1 RT_MANIFEST "platform/windows/godot.manifest" + +1 VERSIONINFO +FILEVERSION GODOT_VERSION_MAJOR,GODOT_VERSION_MINOR,GODOT_VERSION_PATCH,0 +PRODUCTVERSION GODOT_VERSION_MAJOR,GODOT_VERSION_MINOR,GODOT_VERSION_PATCH,0 +FILEOS 4 +FILETYPE 1 +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "FileDescription", GODOT_VERSION_NAME + VALUE "FileVersion", GODOT_VERSION_NUMBER + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/platform/windows/godot_res_wrap_template.rc b/platform/windows/godot_res_wrap_template.rc new file mode 100644 index 000000000000..38c9470387e5 --- /dev/null +++ b/platform/windows/godot_res_wrap_template.rc @@ -0,0 +1,28 @@ +#include "core/version.h" + +#ifndef RT_MANIFEST +#define RT_MANIFEST 24 +#endif + +GODOT_ICON ICON platform/windows/godot_console.ico +1 RT_MANIFEST "platform/windows/godot.manifest" + +1 VERSIONINFO +FILEVERSION GODOT_VERSION_MAJOR,GODOT_VERSION_MINOR,GODOT_VERSION_PATCH,0 +PRODUCTVERSION GODOT_VERSION_MAJOR,GODOT_VERSION_MINOR,GODOT_VERSION_PATCH,0 +FILEOS 4 +FILETYPE 1 +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "FileDescription", GODOT_VERSION_NAME " (Console)" + VALUE "FileVersion", GODOT_VERSION_NUMBER + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END