System Information Unit
|Date:||12 September 2016|
This unit contains a group of static classes and some global variables that provide information about the user's computer system and operating system. Some useful constants and type definitions are also included. The static classes are:
TPJComputerInfoProvides information about the host computer and current user.
TPJSystemFoldersGets the full path to certain system folders.
TPJOSInfoSupplies information about the operating system information including the platform, product name, product ID code, version and service packs.
In addition, the unit extends the information provided by the
SysUtils unit's Win32xxx variables (such as
Win32Platform) by defining further Win32xxx variables
that store the extended operating system information available on later NT
This unit is designed for compilation with the 32 bit and 64 bit Windows
Delphi compilers. The current release has been tested only with Delphi XE.
An attempt has been made to retain compatibility back to Delphi 4, but this
has not been tested and is not guaranteed. Please Create a ticket (with Project field set to
sysinfo) if you find about
compiler from Delphi 4 onwards where the project fails to compile
and you're prepared to test fixes.
Compilation on old Delphi versions that do not support setting registry access flags via TRegistry is not recommended since parts of the code may not work correctly on 64 bit Windows. Use of Delphi 6 or later is strongly recommended.
The unit not compatible with .NET.
The unit should operate correctly on the following platforms:
- Windows 95 to Me.
- All 32 bit Windows NT platform operating systems.
- Windows 64 bit, either as part of a 32 bit or 64 bit process.
The unit can be used with both the VCL and the FireMonkey 2 frameworks.
The code is not suitable for non-Windows operating systems since it depends on the Windows API.
Effect of changes to the Windows API
The behaviour of TPJOSInfo changed with the release of Windows 8.1 following Microsoft's controversial decision to deprecate the GetVersion*** API functions. Similar, even more questionable changes occured with Windows 10. See the project documentation for full details of these changes.
From release 5.0 the unit has been revised to use an alternative approach for getting operating system information that avoids the use of the deprecated API on Windows 8.1 and later.
To enable the new Windows 8 and later OS information detection code to be
debugged on Windows Vista and Windows 7, developers can temporarily define the
DEBUG_NEW_API symbol. This causes the Windows 8 and later
detection method to used for Windows Vista and later.
To help with debugging developers can also define the
symbol. Range checking is forced on when
DEBUG is defined.
Version 2 and earlier of the unit provided the TPJSysInfo component and various SIGetxxx functions. As of v3.0 these were deprecated and included only if a certain symbol was defined. From v4.0 all the deprecated code was removed.
If you are still using the deprecated code you a strongly advised to update the code to use the new classes or to revert to using the last v3.x release.
The System Information Unit is fully documented online.
There is no help file.
Two demo projects are included in the download in the
Demos\FMX directories. The former compiles to a VCL
application while the latter uses the FireMonkey 2 framework and requires
Delphi XE3 as a minimum. Both projects can be compiled to either Windows 32
bit or 64 bit targets.
Each project contains a tab set where each tab displays the information from one of the classes or the global variables.
The VCL demo has been tested with Delphi XE and XE4 but should compile with Delphi 7 (and maybe even Delphi 4) or later, although some unrecognised form properties may need to be ignored. The FireMonkey demo was tested with Delphi XE4.
Feedback & Queries
If you find any bugs or want to suggest a new feature please report them using the Issue Tracker.
Click the Create Ticket button to create a ticket then complete the
form giving as much information as possible. Please note:
this issue tracker is shared among all the projects in the DelphiDabbler
Code Library, so please make sure you enter
sysinfo in the
Project edit box. You should also choose
Defect in the
Type drop down list to report a bug or
request a new feature.
If you have created a bug fix or have implemented a new feature please attach a zip file to your ticket that contains your source code.
Should you have any queries about using the components please read the documentation.
If you can't find an answer in the documentation then post a message in the discussion group.