Search code examples
delphiwinapioperating-systemversioninfo

How to detect Windows KN / K / N edition


Delphi Xe, Win7x64

How to detect incomplete Windows edition N or K (Win XpSp3-Win7x64)? Without IE, Wmp.

Example:

Function isWinKNedition:bool;
begin
result:=?????
end;

...

procedure TForm1.FormCreate(Sender: TObject);
begin
if isWinKNedition then begin showmessage('This program can work only on full versions OS Windows');Halt;end;
end;

Solution

  • According to MSDN you can use either GetProductInfo or WMI Win32_OperatingSystem class (see OperatingSystemSKU description) to detect "N" editions. Note that both methods are not supported by Windows XP (requires Vista or above)

    To detect Windows XP "K" editions you can check registry key, see http://support.microsoft.com/kb/922474 (Changes to the Windows registry section).