procedure GetOSInfo;
var
Platform: string;
BuildNumber: integer;
begin
case Win32Platform of
Ver_Platform_Win32s:
begin
Platform := 'Windows 3.1';
BuildNumber := 0;
end;
VER_PLATFORM_WIN32_WINDOWS:
begin
Platform := 'Windows 95';
BuildNumber := Win32BuildNumber and $0000FFFF;
end;
VER_PLATFORM_WIN32_NT:
begin
Platform := 'Windows NT';
BuildNumber := Win32BuildNumber;
end;
else
begin
Platform := 'Windows';
BuildNumber := 0;
end;
end;
if (Win32MajorVersion = 4) and (Win32MinorVersion = 9) then
Platform := 'Windows Me';
if (Win32MajorVersion = 4) then
if (Win32MinorVersion = 10) then
Platform := 'Windows 98Se'
else
Platform := 'Windows 98';
if (Win32MajorVersion = 5) and (Win32MinorVersion = 0) then
Platform := 'Windows 2000';
if (Win32MajorVersion = 5) and (Win32MinorVersion = 1) then
Platform := 'Windows Xp';
if (Win32MajorVersion = 5) and (Win32MinorVersion = 2) then
Platform := 'Windows 2003';
if (Win32MajorVersion = 6) and (Win32MinorVersion = 0) then
Platform := 'Windows Vista';
if (Win32MajorVersion = 6) and (Win32MinorVersion = 1) then
Platform := 'Windows 7';
if (Win32MajorVersion = 6) and (Win32MinorVersion = 2) then
Platform := 'Windows 8';
if (Win32Platform = VER_PLATFORM_WIN32_WINDOWS) or
(Win32Platform = VER_PLATFORM_WIN32_NT) then
begin
if Win32CSDVersion = '' then
OS.Caption := Format('%s (Build %d)', [Platform, BuildNumber])
else
OS.Caption := Format('%s (Build %d: %s)', [Platform, BuildNumber, Win32CSDVersion]);
end
else
OS.Caption := Format('%s %d.%d', [Platform, Win32MajorVersion,
Win32MinorVersion])
end;