$fverpcmp(path,version)
The $fverpcmp function compares the product version of the file specified by path with the version specified by version and returns a value < 0, 0, or > 0 depending on the comparison result:
| Relative versions | Result |
|---|---|
| Product version(path) < version | < 0 |
| Product version(path) = version | 0 |
| Product version(path) > version | > 0 |
The result can be used in conditional expressions; see Examples below.
If path does not refer to a file, if the file does not exist, or if the file does not have a VERSIONINFO resource, then its product version is treated as if it were 0.0.0.0.
The version parameter must consist of up to 4 decimal numbers separated by periods: a.b.c.d, from most to least significant. You may leave off less significant numbers; any missing numbers are treated as 0. Therefore, 2.1.0.0, 2.1.0 and 2.1 are equivalent.
The comparison is done numerically, not as text. This means, for example, that if the product version of path is 2.19, then $fverpcmp(path, 2.2) is > 0, because 19 > 2. It also means that 2.2 and 2.20 are not the same version (but 2.2 and 2.2.0 are).
Tip: To compare file versions instead of product versions, use the $fverfcmp function.
Windows Installer does not support symbolic functions; if you use this function
during an MSI build, you will get diagnostic message BLD:U0010
and the result is undefined.
All parameters may contain symbolic references; these are resolved before the function is applied. See Examples below.
Here are some usage examples for this function: