From c3f58de85616762c3273cd2d30b3cca15c0ca1c5 Mon Sep 17 00:00:00 2001 From: Dylan Deverill Date: Tue, 18 Aug 2026 22:26:49 -0700 Subject: [PATCH] Stamp the build into the binary and into the first line of its log A release carried no version anywhere a user or a maintainer could see it. The exe had no VERSIONINFO, so its properties showed nothing, and events.log opened with a bare "=== SteamlessController started ===". Twice while chasing #79 a reporter's log arrived and there was no way to tell which of two builds had written it, which cost a round trip each time. resource.h now holds the version once, and both consumers read it from there: app.rc builds a VERSIONINFO resource so Explorer and Programs and Features can report it, and the startup line names it. Keeping them on one definition means a binary and its log can never disagree about what they are. InnoInstallerScript.iss still carries its own copy of the number. Inno can read it back out of the built exe instead, which would leave one place to edit, but that makes the installer refuse to compile before the app is built and is a change to how releases are cut rather than to the app. Co-Authored-By: Claude Opus 5 --- resources/InnoInstallerScript.iss | 2 +- resources/app.rc | 28 ++++++++++++++++++++++++++++ resources/resource.h | 11 +++++++++++ src/app/TrayApp.cpp | 2 +- 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/resources/InnoInstallerScript.iss b/resources/InnoInstallerScript.iss index 2869d6f..4794e17 100644 --- a/resources/InnoInstallerScript.iss +++ b/resources/InnoInstallerScript.iss @@ -3,7 +3,7 @@ ; Non-commercial use only #define MyAppName "SteamlessController" -#define MyAppVersion "1.17" +#define MyAppVersion "1.17.3" #define ViGEmSetup "ViGEmBus_1.22.0_x64_x86_arm64.exe" #define MyAppPublisher "Dylan Deverill" #define MyAppURL "https://github.com/ddeverill/SteamlessController" diff --git a/resources/app.rc b/resources/app.rc index 36871e4..40bc53d 100644 --- a/resources/app.rc +++ b/resources/app.rc @@ -1,5 +1,33 @@ #include "resource.h" +#include IDI_ICON_OFF ICON "SteamControllerOFF.ico" IDI_ICON_ON ICON "SteamControllerON.ico" IDI_ICON_SHARED ICON "SteamControllerSHARED.ico" + +VS_VERSION_INFO VERSIONINFO + FILEVERSION APP_VERSION_MAJOR,APP_VERSION_MINOR,APP_VERSION_PATCH,0 + PRODUCTVERSION APP_VERSION_MAJOR,APP_VERSION_MINOR,APP_VERSION_PATCH,0 + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS 0x0L + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "FileDescription", "SteamlessController" + VALUE "FileVersion", APP_VERSION_STR + VALUE "InternalName", "SteamlessController" + VALUE "OriginalFilename", "SteamlessController.exe" + VALUE "ProductName", "SteamlessController" + VALUE "ProductVersion", APP_VERSION_STR + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/resources/resource.h b/resources/resource.h index 0718bde..3c8864d 100644 --- a/resources/resource.h +++ b/resources/resource.h @@ -5,3 +5,14 @@ // Game mode is live, but on a handle shared with another writer (typically // Steam) rather than an exclusive one — see ControllerManager::IsGameModeShared. #define IDI_ICON_SHARED 103 + +// One definition of the version, for the VERSIONINFO resource in app.rc and for +// the startup line in the event log. Both matter: a build with no version stamp +// is indistinguishable from any other once it is installed, and a log that does +// not say which build wrote it costs a round trip with whoever reported the bug. +// +// Keep in step with MyAppVersion in resources/InnoInstallerScript.iss. +#define APP_VERSION_MAJOR 1 +#define APP_VERSION_MINOR 17 +#define APP_VERSION_PATCH 3 +#define APP_VERSION_STR "1.17.3" diff --git a/src/app/TrayApp.cpp b/src/app/TrayApp.cpp index 960026b..86eb7bb 100644 --- a/src/app/TrayApp.cpp +++ b/src/app/TrayApp.cpp @@ -92,7 +92,7 @@ bool TrayApp::Init(HINSTANCE hInstance) { {0x88, 0xCB, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30}}; RegisterDeviceNotificationW(m_hwnd, &filter, DEVICE_NOTIFY_WINDOW_HANDLE); - EventLog::Write("=== SteamlessController started ==="); + EventLog::Write("=== SteamlessController %s started ===", APP_VERSION_STR); m_startTick = GetTickCount64(); QueryUnbiasedInterruptTime(&m_lastHeartbeatUnbiased);