» Contents
This unit contains a group of static classes and some global variables that provide information about the user's computer system and operating system. The static classes are:
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 platform OSs.
The TPJSysInfo component and SIGetxxx functions provided in earlier versions of the unit are still available. They have been re-implemented to call methods of the above static classes. The component and functions have been made available for backward compatibility but are now deprecated and should not be used in new code.
There was a bug in v2.0 that raised an exception when accessing TPJOSInfo.ProductName on Windows 2003. This was fixed in v2.0.1. Thanks to Guillermo Fazzolari for reporting and fixing this.
» Contents
This unit works with all editions of Delphi from 3 to 7. It should also work with the Delphi 2005 and later Win32 compilers but the unit has not been tested with them. The unit no longer compiles with Delphi 2.
Since the unit makes unmanaged calls to the Windows API the unit will not work with Delphi.net compilers.
The included demo project will not compile with Delphi 3.
The supplied help file is designed to integrate with the Delphi 3 to 7 IDEs. It will not integrate with Delphi 2005.
» Contents
A demo project is included in the download. The project contains a tab set where each tab displays the information from one of the classes, global variables, and the deprecated functions and component.
Since the demo exercises the deprecated code you will get "deprecated" warnings when building with Delphi 6 and later.
Note: the demo project does not compile with Delphi 3 since it uses overloaded methods.
» Contents
The System Information Unit and the demo program are supplied in a zip file. Before installing you need to extract all the files from the zip file, preserving the directory structure. The following files will be extracted:
PJSysInfo.pas
– source code of the
static classes, global variables and deprecated functions and
component.
PJSysInfo.dcr
– resource file
containing the component's glyph.
PJSysInfo.hlp
– unit help file (integrates
with Delphi 3..7 IDE).
PJSysInfo.als
– "a-keyword" file
for integration with Delphi 6 or 7 OpenHelp system.
ReadMe.htm
– information sheet.
ChangeLog.txt
– unit's change log.
Demo\SysInfoDemo.dpr
– demo program project
file.
Demo\SysInfoDemo.res
– demo program resource
file (contains icon).
Demo\SysInfoDemo.cfg
– compiler config file
for demo program.
Demo\FmDemo.pas
– demo program main form
source code.
Demo\FmDemo.dfm
– demo program main form.
You can now proceed to install the unit using the
emphasised files above. Installation methods vary between
Delphi versions, so follow the instructions that apply to your version
below. Note that $(DELPHI)
represents the
path where the appropriate version of Delphi was installed. Similarly
$(BDS)
refers to the installation path of a
version of the Borland Development System.
The unit must be installed into a Delphi Win32 design package. It is assumed
that you will be installing into an existing package. You may decide to
install into the "user" package:
$(BDS)\Lib\dclusr.dpk
.
Borland Studio Projects
or $(BDS)\lib
folders.
PJSysInfo.pas
and PJSysInfo.dcr
to the
chosen installation folder.
.bpl
extension. Right click the package's entry and
select Add to display the Add dialog box.
Enter the full path to PJSysInfo.pas
in the
Unit file name edit box (use the Browse button
to navigate to the file). Click OK to add the component
to the package.
PJSysInfo.pas
from the
chosen installation folder.
The components must be installed into a design package. It is assumed that
you will be installing into an existing package. You may wish to use the
"user" package named dclusr.dpk
or
dclusrXX.dpk
(where XX
is a version number). This
package can be found in $(DELPHI)\Lib
. Ensure that the chosen
package "requires" designide.dcp
.
$(DELPHI)\lib
folder.
PJSysInfo.pas
and PJSysInfo.dcr
to the
chosen installation folder.
PJSysInfo.pas
in the Unit file
name edit box (use the adjacent Browse button to
navigate to the file). Choose the required package from the
Package description combo box, or by navigating to the
package using Browse. Click OK to confirm your
selections.
PJSysInfo.pas
from the
chosen installation folder.
.als
file. The simplest way to install help is to use my
Component Help
Installer Expert (v2.2.1 or later). If you prefer to install
manually,
this
article explains the process.
» Contents
A complete change log is provided in a text file that is included in the download.
» Contents
This source code is subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this source code except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/.
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
The Original Code is PJSysInfo (System Information Unit).
The Initial Developer of the Original Code is Peter Johnson (http://www.delphidabbler.com/).
Portions created by the Initial Developer are Copyright © 2001-2005 Peter Johnson. All Rights Reserved.
Contributor(s):
Guillermo Fazzolari (bug fix in v2.0.1)
All relevant trademarks are acknowledged.
» Contents
I'm Peter Johnson – a hobbyist programmer living in Ceredigion in West Wales, UK, writing write mainly in Delphi. My programs are available for download from: http://www.delphidabbler.com/.
I can be contacted via the website.