2017-02-05 172 views

回答

1

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; 
+0

你如何制定出十六進制的代碼?什麼是'$ 06030000'?我不想阻止任何新版本。我們希望至少允許。 Win 7 SP1,Win 81或Win 10或更高版本。另外,我是否從我的設置部分刪除了'MinVersion'? –

+1

我編輯了我的答案,不要求十六進制數字+'06030000'(是)6.3(Windows 8.1)。 '(WindowsVersion> = MakeVersion(6,2,0))和(WindowsVersion

+0

啊,我明白了。您正在檢測何時無法安裝。因此,如果