2

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;
kludg
  • 27,213
  • 5
  • 67
  • 118
Gu.
  • 1,947
  • 4
  • 30
  • 49
  • This isn't really a complete question. What program are you referring to? The default file type handlers or something else? – Delan Azabani Aug 04 '11 at 01:39
  • Well, I will add. See example – Gu. Aug 04 '11 at 01:51
  • 2
    I think you're asking the wrong question. If your program requires IE or WMP, check for them, NOT the edition of windows. (It's possible to remove these programs from non-N and K editions, and it's possible to install them on the N and K editions) – Jon Aug 04 '11 at 18:11

2 Answers2

9

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

kludg
  • 27,213
  • 5
  • 67
  • 118
0

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

check this article

CloudyMarble
  • 36,908
  • 70
  • 97
  • 130