Skip to content

Commit 9109766

Browse files
Merge pull request #38 from meridianfield/fix/windows-build-version-tuple
fix(build-windows): derive numeric PE version tuple for Nuitka
2 parents f6cef6f + 90f581e commit 9109766

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

scripts/build_windows.bat

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ REM Read version from VERSION.json (single source of truth)
3737
for /f "usebackq delims=" %%V in (`powershell -NoProfile -Command "(Get-Content '%REPO_ROOT%\data\VERSION.json' | ConvertFrom-Json).app_version"`) do set "APP_VERSION=%%V"
3838
echo ==^> Version: %APP_VERSION%
3939

40+
REM Windows PE resource versions (FILEVERSION/PRODUCTVERSION) must be a numeric
41+
REM 4-part tuple, so strip any SemVer pre-release suffix and pad to 4 integers
42+
REM (e.g. "0.2.1-beta" -> "0.2.1.0"). User-facing version strings keep the suffix.
43+
for /f "usebackq delims=" %%V in (`powershell -NoProfile -Command "$n=('%APP_VERSION%' -split '-')[0]; $p=@($n -split '\.'); while($p.Count -lt 4){$p+='0'}; ($p[0..3] -join '.')"`) do set "WIN_VERSION=%%V"
44+
echo ==^> Windows resource version: %WIN_VERSION%
45+
4046
echo ==^> Cleaning previous build
4147
if exist "%BUILD_DIR%" rmdir /s /q "%BUILD_DIR%"
4248
mkdir "%BUILD_DIR%"
@@ -94,8 +100,8 @@ uv run python -m nuitka ^
94100
--windows-product-name=PushNav ^
95101
--windows-company-name="Arun Venkataswamy" ^
96102
--windows-file-description="PushNav - plate-solving push-to" ^
97-
--windows-product-version=%APP_VERSION%.0 ^
98-
--windows-file-version=%APP_VERSION%.0 ^
103+
--windows-product-version=%WIN_VERSION% ^
104+
--windows-file-version=%WIN_VERSION% ^
99105
--output-dir="%BUILD_DIR%" ^
100106
--output-filename=PushNav.exe ^
101107
--include-package=numpy ^

0 commit comments

Comments
 (0)