Inno Setup中VersionInfoVersion指令值无效编译报错咨询
Hey, let's break down why you're hitting this error and how to fix it quickly:
The core issue here is that VersionInfoVersion strictly follows Windows file version number rules—each of the four dot-separated segments in the version string must be a 16-bit unsigned integer, meaning the maximum value for any segment is 65535. Your version 0.4.0.201801182 has a final segment (201801182) that's way larger than this limit, which triggers the "invalid value" error during compilation.
Here are a few practical solutions to resolve this:
Shorten the problematic segment
That final segment looks like a date stamp (2018-01-18 with an extra digit). You can simplify it to a value under65535, like using1801(month + day) to get0.4.0.1801, or18(day of the year) for0.4.0.18. Pick a format that still makes sense for your version tracking.Restructure your version string
If you want to keep more date context without exceeding the limit, split the date across multiple segments. For example:VersionInfoVersion=0.4.2018.118Here, each segment (
0,4,2018,118) is well under65535, and you still retain the year (2018) and day of year (118) for reference.Use
VersionInfoTextVersionfor full display
If you need the full long version string to show up in the installer's file properties, separate the compliant version for compilation from the display version:[Setup] VersionInfoVersion=0.4.0.1801 ; Compliant with Windows limits VersionInfoTextVersion=0.4.0.201801182 ; Full version shown to usersThis way, the compiler accepts the valid
VersionInfoVersion, and users still see your complete version string when checking the installer's details.
Just double-check that every segment in your VersionInfoVersion value is ≤ 65535, and your compilation should run without issues.
内容的提问来源于stack exchange,提问作者user707779

