I have several places in my script where I work with version numbers:
Scenario 1
#define AppVerText() \ GetVersionComponents(SourceDir + '\Meeting Schedule Assistant.exe', \ Local[0], Local[1], Local[2], Local[3]), \ Str(Local[0]) + "." + Str(Local[1]) + "." + Str(Local[2])
Scenario 2
{ Is the installed version at least 14.14 ? } Result := (Major < 14) or ((Major = 14) and ((Minor < 14) or ((Minor = 14) and ((Bld < 26429) or ((Bld = 26429) and (Rbld < 3)))))); if (Result) then
The various values were extracted from registry keys.
Scenario 3
{ Check Windows Version } WindowsVersion := GetWindowsVersion; Log(Format('Windows Version: %x', [WindowsVersion])); (* Windows must be Win 7 SP1 (6.1.7601), Win 8.1 (6.3.9200) or higher, eg: Win 10 (10.0.10240) See: http://www.jrsoftware.org/ishelp/index.php?topic=winvernotes Microsoft .Net Framework 4.6.2 will only work with these operating systems. *) if (WindowsVersion < MakeVersion(6, 1, 7601)) or ((WindowsVersion >= MakeVersion(6, 2, 0)) and (WindowsVersion < MakeVersion(6, 3, 0))) then begin MsgBox(SetupMessage(msgWindowsVersionNotSupported), mbError, MB_OK); Result := False; end;
Which calls:
function MakeVersion(Major, Minor, Build: Cardinal): Cardinal; begin Result := (Major shl 24) + (Minor shl 16) + Build; end;
I just wondered if we were able to make use of the new "version" Pascal functions etc. introduced in Inno Setup 6.1?