Gu.
Gu.

Reputation: 1957

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;

Upvotes: 2

Views: 2641

Answers (2)

kludg
kludg

Reputation: 27493

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).

Upvotes: 9

CloudyMarble
CloudyMarble

Reputation: 37576

Try using the GetVersionEx WinApi, it provides version information about the operating system including ServicePack info.

check this article

Upvotes: 0

Related Questions