xW: set version information

This commit is contained in:
Přemysl Eric Janouch 2023-07-15 23:34:37 +02:00
parent 0219dbd026
commit 90859107c8
Signed by: p
GPG Key ID: A0420B94F92B9493
3 changed files with 45 additions and 3 deletions

View File

@ -1,6 +1,14 @@
#ifndef CONFIG_H #ifndef CONFIG_H
#define CONFIG_H #define CONFIG_H
#define PROGRAM_VERSION "${project_version}" #define PROJECT_NAME "${PROJECT_NAME}"
#define PROJECT_VERSION "${project_version}"
#define PROJECT_DESCRIPTION "${PROJECT_DESCRIPTION}"
#define PROJECT_AUTHOR "Přemysl Eric Janouch"
#define PROJECT_MAJOR (${PROJECT_VERSION_MAJOR}-0)
#define PROJECT_MINOR (${PROJECT_VERSION_MINOR}-0)
#define PROJECT_PATCH (${PROJECT_VERSION_PATCH}-0)
#define PROJECT_TWEAK (${PROJECT_VERSION_TWEAK}-0)
#endif // ! CONFIG_H #endif // ! CONFIG_H

View File

@ -18,6 +18,7 @@
#include "xC-proto.cpp" #include "xC-proto.cpp"
#include "xW-resources.h" #include "xW-resources.h"
#include "config.h"
#include <winsock2.h> #include <winsock2.h>
#include <ws2tcpip.h> #include <ws2tcpip.h>
@ -1744,11 +1745,12 @@ wWinMain(HINSTANCE hInstance, [[maybe_unused]] HINSTANCE hPrevInstance,
wc.hIcon = g.hicon; wc.hIcon = g.hicon;
wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = GetSysColorBrush(COLOR_3DFACE); wc.hbrBackground = GetSysColorBrush(COLOR_3DFACE);
wc.lpszClassName = L"xW"; wc.lpszClassName = TEXT(PROJECT_NAME);
if (!RegisterClassEx(&wc)) if (!RegisterClassEx(&wc))
return 1; return 1;
g.hwndMain = CreateWindowEx(WS_EX_CONTROLPARENT, L"xW", L"xW", g.hwndMain = CreateWindowEx(
WS_EX_CONTROLPARENT, wc.lpszClassName, TEXT(PROJECT_NAME),
WS_OVERLAPPEDWINDOW, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, 600, 400, NULL, NULL, hInstance, NULL); CW_USEDEFAULT, CW_USEDEFAULT, 600, 400, NULL, NULL, hInstance, NULL);

View File

@ -1,6 +1,12 @@
#include <windows.h> #include <windows.h>
#include "xW-resources.h" #include "xW-resources.h"
// https://devblogs.microsoft.com/oldnewthing/20190607-00/?p=102569
// For UTF-8 literals to work in both MinGW and Microsoft resource compilers,
// the pragma needs to be in this file, and before they're included.
#pragma code_page(65001)
#include "config.h"
// Beware of this madness https://gitlab.kitware.com/cmake/cmake/-/issues/23066 // Beware of this madness https://gitlab.kitware.com/cmake/cmake/-/issues/23066
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "xW.manifest" CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "xW.manifest"
@ -21,3 +27,29 @@ BEGIN
"H", ID_TOGGLE_UNIMPORTANT, ALT "H", ID_TOGGLE_UNIMPORTANT, ALT
"h", ID_DISPLAY_FULL_LOG, ALT "h", ID_DISPLAY_FULL_LOG, ALT
END END
VS_VERSION_INFO VERSIONINFO
FILEVERSION PROJECT_MAJOR, PROJECT_MINOR, PROJECT_PATCH, PROJECT_TWEAK
PRODUCTVERSION PROJECT_MAJOR, PROJECT_MINOR, PROJECT_PATCH, PROJECT_TWEAK
FILETYPE VFT_APP
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", PROJECT_AUTHOR
VALUE "FileDescription", PROJECT_DESCRIPTION
VALUE "FileVersion", PROJECT_VERSION
VALUE "InternalName", PROJECT_NAME
VALUE "LegalCopyright", PROJECT_AUTHOR
VALUE "OriginalFilename", PROJECT_NAME ".exe"
VALUE "ProductName", PROJECT_NAME
VALUE "ProductVersion", PROJECT_VERSION
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END