5

Using either the registry or the file system. The reason for the restriction is that I am doing this as an MSI conditional statement.

Cheers!

Duncan Edwards
  • 1,528
  • 2
  • 19
  • 32
  • Seeing as how you can right click and go to the properties on My Computer, this should be very simple for someone to answer with experience about where this information is stored. Sadly that's not me :) – TheTXI May 14 '09 at 12:08
  • The title of this question got my hopes up, and then I read the part about registry or file system. :( – Scott Jul 03 '09 at 20:06

5 Answers5

5

under registry key

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion

look for key pair:

CurrentVersion = Microsoft Windows NT 5.1.2600 Service Pack 3

kloucks
  • 1,549
  • 9
  • 11
4

You should find enough information to determine the OS service pack (in the worst case you can always use the build string) in the following registry key:


HKLM\Software\Microsoft\Windows NT\CurrentVersion
em70
  • 6,088
  • 6
  • 48
  • 80
2

If you're using an MSI, you should be able to use the VersionNT and ServicePackLevel properties right in the conditional statement.

eg. The following code checks for Windows XP sp3 or greater:

VersionNT=501 And ServicePackLevel>2

You can also check the WindowsBuild property if you also need the build number.

Kevin Kibler
  • 13,357
  • 8
  • 38
  • 61
1

The VerifyVersionInfo function should allow you to check the version of Windows being run meets your application's requirements, without the pitfalls that can occur with checking for an exact version with GetVersionEx (such as breaking on major version changes - your application will most likely run on Vista, and Windows 7, and future versions not yet developed).

Jason Owen
  • 7,200
  • 3
  • 21
  • 25
-1

"Run" (Windows key + r or start/run) msinfo32 or sysdm.cpl

Jimbo66
  • 1
  • 1