从InitializeSetup
event function使用GetWindowsVersion
function来实现自定义的限制:
function MakeVer(Major, Minor, Build: Cardinal): Cardinal;
begin
Result := (Major shl 24) + (Minor shl 16) + Build;
end;
function InitializeSetup(): Boolean;
var
WindowsVersion: Cardinal;
begin
Result := True;
WindowsVersion := GetWindowsVersion;
Log(Format('Windows Version: %x', [WindowsVersion]));
if (WindowsVersion < MakeVer(6, 1, 7601)) or
((WindowsVersion >= MakeVer(6, 2, 0)) and (WindowsVersion < MakeVer(6, 3, 0))) then
begin
MsgBox(SetupMessage(msgWindowsVersionNotSupported), mbError, MB_OK);
Result := False;
end;
end;
你如何制定出十六进制的代码?什么是'$ 06030000'?我不想阻止任何新版本。我们希望至少允许。 Win 7 SP1,Win 81或Win 10或更高版本。另外,我是否从我的设置部分删除了'MinVersion'? –
我编辑了我的答案,不要求十六进制数字+'06030000'(是)6.3(Windows 8.1)。 '(WindowsVersion> = MakeVersion(6,2,0))和(WindowsVersion
啊,我明白了。您正在检测何时无法安装。因此,如果