Welcome to the new DelphiDabbler Code Library Documentation.

This is a new site that's currently running on alpha code. There are going to be bugs. If you discover any, please report them on the site's issues page (GitHub account required). Thanks.

Warning: Many URLs are going to change. Refer to the README file to discover which library project's documentation has been completed.

ServicePackMajor class function

Project: System Information Unit.

Unit: PJSysInfo.

Class: TPJOSInfo

Applies to: ~>5.0

class function ServicePackMajor: Integer;


On the NT platform from NT 4 service pack 6 onwards ServicePackMajor returns the major version number of any service pack applied to the operating system. Zero is returned if no service pack has been applied. On earlier versions of Windows NT or on the Windows 9x platform, zero is alwys returned.

The corresponding minor service pack version number is provided by the ServicePackMinor method. A full description of the service pack, for any product, is available via the ServicePack method.

When the program is run in compatibility mode, this method will return the service pack major version of the “emulated” operating system.

On operating systems where CanSpoof returns False this method will return the service pack major version of the installed operating system, regardless of any compatibility mode.