要求在安装时检测Windows 10或更高版本。为此,我创建了以下功能。
它在Windows 10和Windows 8.1中给我603(AS VersionNT值)。那是错的。
还有其他方法可以做到这一点吗?
function BOOL isWindows10OrGreater()
STRING svWindowsValue;
NUMBER nWindowsValue;
NUMBER nBuffer;
begin
try
nBuffer = 256;
MsiGetProperty(ISMSI_HANDLE,"VersionNT",svWindowsValue,nBuffer);
StrToNum(nWindowsValue,svWindowsValue);
return (nWindowsValue >= 603);
catch
return FALSE;
endcatch;
end;
Run Code Online (Sandbox Code Playgroud)