Хамик
Старожил
У кого есть возможность проверить код на разных версиях Windows, правильно ли условия прописаны? Потребовалось в секции code, для удобства, аналог MinVersion и OnlyBelowVersion.
Код:
[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Ap
[code]
function IsWindowsVersion(MinVerMajor, MinVerMinor, OnlyBelowVerMajor, OnlyBelowVerMinor: Integer): Boolean;
var
Version: TWindowsVersion;
begin
GetWindowsVersionEx(Version);
if ((MinVerMajor > 0) and (OnlyBelowVerMajor > 0)) then
Result := ((Version.Major >= MinVerMajor) and (Version.Minor >= MinVerMinor)) and ((Version.Major < OnlyBelowVerMajor) and (Version.Minor < OnlyBelowVerMinor)) else
if ((MinVerMajor > 0) and (OnlyBelowVerMajor = 0)) then
Result := (Version.Major > MinVerMajor) or ((Version.Major = MinVerMajor) and (Version.Minor >= MinVerMinor)) else
if ((MinVerMajor = 0) and (OnlyBelowVerMajor > 0)) then
Result := ((Version.Major < OnlyBelowVerMajor) or ((Version.Major < OnlyBelowVerMajor) and (Version.Minor < OnlyBelowVerMinor)));
end;
function InitializeSetup(): Boolean;
begin
Result := IsWindowsVersion(10, 0, 0, 0);
end;