function IsWin7: boolean;
var
osVerInfo: TOSVersionInfo;
majorVersion, minorVersion: integer;
begin
Result:= false;
osVerInfo.dwOSVersionInfoSize:= SizeOf(TOSVersionInfo);
if GetVersionEx(osVerInfo)
then
begin
minorVersion:= osVerInfo.dwMinorVersion;
majorVersion:= osVerInfo.dwMajorVersion;
if osVerInfo.dwPlatFormId = VER_PLATForm_WIN32_NT
then
if (majorVersion = 6)
and (minorVersion = 1)
then
Result:= true;
end;
end;
function IsWow64: boolean;
type
TIsWow64Process =
function(
Handle: Windows.THandle;
var Res: Windows.BOOL): Windows.BOOL;
stdcall;
var
IsWow64Result: Windows.BOOL;
IsWow64Process: TIsWow64Process;
begin
Result:= False;
if IsWin7
then
begin
IsWow64Process :=
Windows.GetProcAddress(Windows.GetModuleHandle('
kernel32'), '
IsWow64Process');
if Assigned(IsWow64Process)
then
try
IsWow64Process(Windows.GetCurrentProcess, IsWow64Result);
Result:= IsWow64Result;
except
Result:= False;
end;
end;
end;
function GetRegPath:
string;
var
Substr:
string;
begin
if IsWow64
then
Substr:= '
Wow6432Node\'
else
Substr:= '
';
Result:= '
SOFTWARE\' + Substr + '
Moeller Computer\MED Base\'
end;