Skip to content

Fix default version string format#50

Open
scc-tw wants to merge 1 commit into
BenjaminRi:masterfrom
scc-tw:fix-version-string-format
Open

Fix default version string format#50
scc-tw wants to merge 1 commit into
BenjaminRi:masterfrom
scc-tw:fix-version-string-format

Conversation

@scc-tw

@scc-tw scc-tw commented Jun 5, 2026

Copy link
Copy Markdown

Summary

Fixes #49.

WindowsResource::new() currently initializes the string-table FileVersion and ProductVersion from CARGO_PKG_VERSION, while the fixed FILEVERSION and PRODUCTVERSION values are generated as Windows four-part versions.

For a Cargo version like 1.7.5, that produces:

FILEVERSION 1, 7, 5, 0
PRODUCTVERSION 1, 7, 5, 0
VALUE "FileVersion", "1.7.5"
VALUE "ProductVersion", "1.7.5"

Windows Shell can then report System.FileVersion as 1.7.5.0 but System.Software.ProductVersion as 1.7.5.

This change derives the default string-table versions from the same fixed version value, so the defaults are consistent (1.7.5.0). Explicit user overrides through .set("FileVersion", ...) or .set("ProductVersion", ...) are still honored.

Testing

cargo fmt
cargo test

@BenjaminRi

Copy link
Copy Markdown
Owner

Thank you for your contribution. I've let the CI run and it looks good. However, I am not quite certain if this is actually an issue and if we should really fix it?

Windows Shell can then report System.FileVersion as 1.7.5.0 but System.Software.ProductVersion as 1.7.5.

There is no rule against this. It seems like even Microsoft themselves do this and it's a perfectly fine practice.

Could you elaborate if you ran into any issues regarding this discrepancy, or if this is purely aesthetic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default version strings differ from fixed VERSIONINFO versions

2 participants