The ServicePackMajorVersion property indicates the major version number of the service pack installed on the computer system. ...

The ServicePackMajorVersion property indicates the major version number of the service pack installed on the computer system. If no service pack has been installed, the value is zero. ServicePackMajorVersion is valid for computers running Windows 2000 and later (NULL otherwise).