From 028ec40165a18899c1cf6a733784699f7f412270 Mon Sep 17 00:00:00 2001 From: Stan Date: Mon, 26 Aug 2024 15:12:12 +0200 Subject: [PATCH] Add a RC file to add metadata to the pyrogenesis executable --- build/premake/premake5.lua | 1 + source/lib/build_version.h | 2 ++ source/lib/sysdep/os/win/pyrogenesis.rc | 38 +++++++++++++++++++++++++ source/ps/Pyrogenesis.cpp | 2 +- 4 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 source/lib/sysdep/os/win/pyrogenesis.rc diff --git a/build/premake/premake5.lua b/build/premake/premake5.lua index 2e94faaf4b..0c257ad5df 100644 --- a/build/premake/premake5.lua +++ b/build/premake/premake5.lua @@ -1070,6 +1070,7 @@ function setup_main_exe () if os.istarget("windows") then files { source_root.."lib/sysdep/os/win/icon.rc" } + files { source_root.."lib/sysdep/os/win/pyrogenesis.rc" } -- from "lowlevel" static lib; must be added here to be linked in files { source_root.."lib/sysdep/os/win/error_dialog.rc" } diff --git a/source/lib/build_version.h b/source/lib/build_version.h index d771b1230c..eea3cae908 100644 --- a/source/lib/build_version.h +++ b/source/lib/build_version.h @@ -20,4 +20,6 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#define PYROGENESIS_VERSION "0.0.27.0" +#define PYROGENESIS_VERSION_WORD 0,0,27,0 extern wchar_t build_version[]; diff --git a/source/lib/sysdep/os/win/pyrogenesis.rc b/source/lib/sysdep/os/win/pyrogenesis.rc new file mode 100644 index 0000000000..9354f087fc --- /dev/null +++ b/source/lib/sysdep/os/win/pyrogenesis.rc @@ -0,0 +1,38 @@ +#include "lib/build_version.h" + +#include + +#ifndef DEBUG +#define VER_DEBUG 0 +#else +#define VER_DEBUG VS_FF_DEBUG +#endif + +VS_VERSION_INFO VERSIONINFO +FILEVERSION PYROGENESIS_VERSION_WORD +PRODUCTVERSION PYROGENESIS_VERSION_WORD +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +FILEFLAGS VER_DEBUG +FILEOS VOS_NT_WINDOWS32 +FILETYPE VFT_APP +FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", "Wildfire Games" + VALUE "FileDescription", "Pyrogenesis engine" + VALUE "FileVersion", PYROGENESIS_VERSION + VALUE "InternalName", "pyrogenesis.rc" + VALUE "LegalCopyright", "Copyright (C) 2024 Wildfire Games" + VALUE "OriginalFilename", "pyrogenesis.rc" + VALUE "ProductName", "Pyrogenesis" + VALUE "ProductVersion", PYROGENESIS_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 0x4E4 + END +END diff --git a/source/ps/Pyrogenesis.cpp b/source/ps/Pyrogenesis.cpp index 9e3486bee1..2e2722e26d 100644 --- a/source/ps/Pyrogenesis.cpp +++ b/source/ps/Pyrogenesis.cpp @@ -24,7 +24,7 @@ #include "lib/sysdep/sysdep.h" #include "lib/build_version.h" -const char* engine_version = "0.0.27"; +const char* engine_version = PYROGENESIS_VERSION; const char* main_window_name = "0 A.D."; // convert contents of file from char to wchar_t and