Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows 8 Consumer Preview Wrong Major Version?

I am using this code to detect the WindowsVersion on a PC.

function GetOS: string;
var
 osVerInfo: TOSVersionInfo;
 majorVer, minorVer: Integer; 
begin
Result := 'Unknown';
osVerInfo.dwOSVersionInfoSize := SizeOf(TOSVersionInfo);
if GetVersionEx(osVerInfo) then
 begin
  majorVer := osVerInfo.dwMajorVersion;
  minorVer := osVerInfo.dwMinorVersion;
  case osVerInfo.dwPlatformId of
  VER_PLATFORM_WIN32_NT: {Mirosoft Windows NT/2000 }
    begin
      if majorVer <= 4 then
        Result := 'Win NT'
      else if (majorVer = 5) and (minorVer = 0) then
        Result := 'Win 2k'
      else if (majorVer = 5) and (minorVer = 1) then
        Result := 'Win XP'
      else if (majorVer = 6) and (minorVer = 0) then
        Result := 'Win Vista'
      else if (majorVer = 6) and (minorVer = 1) then
        Result := 'Win 7'
      else if (majorVer = 6) and (minorVer = 2) then
        Result := 'Win 8'
    end;
  VER_PLATFORM_WIN32_WINDOWS:  { Windows 9x/ME }
    begin
      if (majorVer = 4) and (minorVer = 0) then
        Result := 'Win 95'
      else if (majorVer = 4) and (minorVer = 10) then
      begin
        if osVerInfo.szCSDVersion[1] = 'A' then
          Result := 'Win 98SE'
        else
          Result := 'Win 98';
      end
      else if (majorVer = 4) and (minorVer = 90) then
        Result := 'Win ME'
    end;
  end;
end;
end;

For some reason it says that Windows8 Consumer Preview Build 8250 (32bit) is Windows XP - Major Version 5. I checked and it's supposed to be Version 6.2 (according to notepad.exe on windows8) Is this a bug or is something wrong? btw. my Windows 8 is up2date.

Any Ideas?

EDIT: ScreenShot GETOS

like image 883
Ben Avatar asked May 11 '12 19:05

Ben


People also ask

What is the Windows 8 Consumer Preview?

The Windows 8 Consumer Preview is just that: a preview of what’s to come. It represents a work in progress, and some things will change before the final release. This means you’ll encounter some hiccups and bugs.

What should I know before I download Windows 8?

Before you start the download, there are a few things to keep in mind. The Windows 8 Consumer Preview is just that: a preview of what’s to come. It represents a work in progress, and some things will change before the final release. This means you’ll encounter some hiccups and bugs.

What is the build number of Windows 8 Consumer Preview 8250?

Advanced embedding details, examples, and help ! The Windows 8 Consumer Preview. Subject: . Build number of this is 8250. You don't need to set a BIOS Date, because timebomb is broken.


Video Answer


2 Answers

The reason for this behavior is XP Compatibility mode, Delphi 7 IDE was running under compatibility mode.

like image 51
Antonio Bakula Avatar answered Nov 07 '22 03:11

Antonio Bakula


For Windows 8.0 the version 6.2 is correct - also the Build-Number. With Windows 8.1 you get version 6.2 too. But now the Version-Number ist 6.3 Build 9600. You can see it in the system-info. GetVersionEx allows only 0,1,2 for Win32MinorVersion. If you need this info, you can read it from registry-key 'Version' in HKCU\Software\Microsoft\Internet Explorer\Main\WindowsSearch. Best regards, asks

like image 44
Asks Avatar answered Nov 07 '22 01:11

Asks