Skip to content

Commit aaa2e5a

Browse files
MrLeninclaude
andcommitted
win32: preserve full version string in non-numeric build fields
meson.build's marketing version may carry a pre-release suffix like "3.0.0~alpha1". The build template previously joined the dotted parts back into a string, dropping the suffix everywhere it landed: PACKAGE_VERSION (About dialog, user-agent, tarball name) and the StringFileInfo block (Windows file-properties dialog). Split into two values inside version-template.ps1: $versionFull keeps the full marketing string for those human-readable fields, while $versionParts is the digits-only form for the numeric Win32 VERSIONINFO FILEVERSION/PRODUCTVERSION quad that rejects non-numeric components. poxchat.sln reorder is VS-autosave noise from opening the solution. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 30d317c commit aaa2e5a

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

win32/config.h.tt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
#define ISO_CODES_PREFIX ".\\"
77
#define ISO_CODES_LOCALEDIR LOCALEDIR
88
#define PACKAGE_NAME "poxchat"
9-
#define PACKAGE_VERSION "<#= [string]::Join('.', $versionParts) #>"
9+
#define PACKAGE_VERSION "<#= $versionFull #>"
1010
#define POXCHATLIBDIR ".\\plugins"
1111
#define POXCHATSHAREDIR "."
1212
#define OLD_PERL
1313
#define GETTEXT_PACKAGE "poxchat"
14-
#define PACKAGE_TARNAME "poxchat-<#= [string]::Join('.', $versionParts) #>"
14+
#define PACKAGE_TARNAME "poxchat-<#= $versionFull #>"

win32/poxchat.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lua", "..\plugins\lua\lua.v
112112
EndProject
113113
Global
114114
GlobalSection(SolutionConfigurationPlatforms) = preSolution
115-
Release|Win32 = Release|Win32
116115
Release|x64 = Release|x64
116+
Release|Win32 = Release|Win32
117117
EndGlobalSection
118118
GlobalSection(ProjectConfigurationPlatforms) = postSolution
119119
{87554B59-006C-4D94-9714-897B27067BA3}.Release|Win32.ActiveCfg = Release|Win32

win32/version-template.ps1

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
param ([string] $templateFilename, [string] $outputFilename)
22

3-
$versionParts = Select-String -Path "${env:SOLUTIONDIR}meson.build" -Pattern " version: '([^']+)',$" | Select-Object -First 1 | %{ $_.Matches[0].Groups[1].Value.Split('.') }
3+
# $versionFull keeps the full marketing string from meson.build (e.g.
4+
# "3.0.0~alpha1"), used wherever a human-readable version belongs:
5+
# StringFileInfo's ProductVersion/FileVersion (shown in the Windows file
6+
# properties dialog), PACKAGE_VERSION in config.h (About dialog, user-agent,
7+
# tarball name), etc.
8+
#
9+
# $versionParts is the stripped numeric form (e.g. ["3","0","0"]) used where
10+
# only digits are valid: Win32 VERSIONINFO's top-level FILEVERSION and
11+
# PRODUCTVERSION, which require four numeric components and reject pre-
12+
# release tags like ~alpha1.
13+
$versionFull = Select-String -Path "${env:SOLUTIONDIR}meson.build" -Pattern " version: '([^']+)',$" | Select-Object -First 1 | %{ $_.Matches[0].Groups[1].Value }
14+
$versionParts = $versionFull.Split('.') | %{ if ($_ -match '^(\d+)') { $Matches[1] } else { '0' } }
415

516
[string[]] $contents = Get-Content $templateFilename -Encoding UTF8 | %{
617
while ($_ -match '^(.*?)<#=(.*?)#>(.*?)$') {

0 commit comments

Comments
 (0)