Windows EXE files have version numbers attached to them, consisting of four digits separated by dots (e.g. 1.0.0.0).
Question: What is the correct way to compare these numbers? In particular, is 1.15.0.0 > 1.2.0.0 (since 15 > 2) or vice versa (since, mathematically, 1.15 < 1.2)?
Background: One of my applications has reached 3.9.* and I would like to know wheter I can continue with 3.10.* without installers or other components that compare version numbers causing trouble.
The correct way is to consider each component (delimited by periods ‘.’) in turn as a numeric rather than string value. So, yes 1.15.0.0 is > 1.2.0.0
If you use Powershell it has a built-in version object (based on .NET’s
System.Versiontype):[version]that will perform this functionality for you.[For reference, the individual components are
Major.Minor.Build.Revision]