Skip to content

Commit 8f610e9

Browse files
committed
Merge branch 'release/5.32.0'
Release v5.32.0
2 parents 3857d1a + 8c8d991 commit 8f610e9

8 files changed

Lines changed: 893 additions & 38 deletions

File tree

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Change Log for System Information Unit
22

3+
## v5.32.0 of 02 April 2025
4+
5+
+ Added new TPJBiosInfo class that provides access to some of the information contained in the host computer's BIOS, providing that the BIOS supports the SMBIOS reference specification v2.0 or later.
6+
+ Updated both the VCL and FMX demo programs to add a new tab that displays the results of calling each of the methods of TPJBiosInfo.
7+
+ Removed return values from Exit statements in the PJSysInfo unit to enable compilation with older Delphis.
8+
+ Fixed bug in TPJOSInfo.ProductName where a format string had an incorrect number of placeholders for version numbers.
9+
+ Fixed spelling mistake in the VCL demo project's TPJComputerInfo tab.
10+
+ Changed the descriptive text on the TPJComputerInfo tab of the VCL demo program to refer to the each method's name rather than describing the purpose of the method.
11+
+ Updated documentation:
12+
+ Updated `README.md` re the addition of the TPJBiosInfo class.
13+
+ Updated copyright dates in `README.md` to include 2025.
14+
+ Acknowleged the author of some C code that formed the basis of some of Pascal code in TPJBiosInfo.
15+
316
## v5.31.0 of 01 January 2025
417

518
+ Updated TPJOSInfo to detect Windows builds and revisions released in October to December 2024:

Demos/FMX/FmFMXDemo.fmx

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ object Form1: TForm1
2828
Size.Width = 680.000000000000000000
2929
Size.Height = 500.000000000000000000
3030
Size.PlatformDefault = False
31-
TabIndex = 0
31+
TabIndex = 4
3232
TabOrder = 0
3333
TabPosition = Top
3434
OnChange = TabControl1Change
@@ -40,13 +40,15 @@ object Form1: TForm1
4040
672s
4141
466s
4242
672s
43+
466s
44+
672s
4345
466s)
4446
object tiComputerInfo: TTabItem
4547
CustomIcon = <
4648
item
4749
end>
4850
TextSettings.Trimming = None
49-
IsSelected = True
51+
IsSelected = False
5052
Size.Width = 111.000000000000000000
5153
Size.Height = 26.000000000000000000
5254
Size.PlatformDefault = False
@@ -82,6 +84,45 @@ object Form1: TForm1
8284
end
8385
end
8486
end
87+
object tiBiosInfo: TTabItem
88+
CustomIcon = <
89+
item
90+
end>
91+
TextSettings.Trimming = None
92+
IsSelected = False
93+
Size.Width = 79.000000000000000000
94+
Size.Height = 26.000000000000000000
95+
Size.PlatformDefault = False
96+
StyleLookup = ''
97+
TabOrder = 0
98+
Text = 'TPJBiosInfo'
99+
object sgBiosInfo: TStringGrid
100+
Align = Client
101+
CanFocus = True
102+
ClipChildren = True
103+
Size.Width = 672.000000000000000000
104+
Size.Height = 466.000000000000000000
105+
Size.PlatformDefault = False
106+
TabOrder = 0
107+
RowHeight = 21.000000000000000000
108+
Options = [ColumnResize, ColumnMove, ColLines, RowLines, Tabs, Header, HeaderClick, AutoDisplacement]
109+
OnResized = sgResized
110+
Viewport.Width = 652.000000000000000000
111+
Viewport.Height = 441.000000000000000000
112+
object StringColumn9: TStringColumn
113+
Header = 'Method'
114+
HeaderSettings.TextSettings.WordWrap = False
115+
ReadOnly = True
116+
Size.Width = 240.000000000000000000
117+
end
118+
object StringColumn10: TStringColumn
119+
Header = 'Value'
120+
HeaderSettings.TextSettings.WordWrap = False
121+
ReadOnly = True
122+
Size.Width = 400.000000000000000000
123+
end
124+
end
125+
end
85126
object tiSpecialFolders: TTabItem
86127
CustomIcon = <
87128
item
@@ -169,7 +210,7 @@ object Form1: TForm1
169210
item
170211
end>
171212
TextSettings.Trimming = None
172-
IsSelected = False
213+
IsSelected = True
173214
Size.Width = 97.000000000000000000
174215
Size.Height = 26.000000000000000000
175216
Size.PlatformDefault = False

Demos/FMX/FmFMXDemo.pas

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ TForm1 = class(TForm)
3939
sgWin32Globals: TStringGrid;
4040
StringColumn7: TStringColumn;
4141
StringColumn8: TStringColumn;
42+
tiBiosInfo: TTabItem;
43+
sgBiosInfo: TStringGrid;
44+
StringColumn9: TStringColumn;
45+
StringColumn10: TStringColumn;
4246
procedure TabControl1Change(Sender: TObject);
4347
procedure FormCreate(Sender: TObject);
4448
procedure sgResized(Sender: TObject);
@@ -62,6 +66,7 @@ TForm1 = class(TForm)
6266
procedure ShowTPJOSInfo;
6367
procedure ShowTPJComputerInfo;
6468
procedure ShowTPJSystemFolders;
69+
procedure ShowTPJBiosInfo;
6570
end;
6671

6772
var
@@ -167,9 +172,72 @@ procedure TForm1.ShowContent(Tab: Integer);
167172
begin
168173
case Tab of
169174
0: ShowTPJComputerInfo;
170-
1: ShowTPJSystemFolders;
171-
2: ShowTPJOSInfo;
172-
3: ShowWin32Globals;
175+
1: ShowTPJBiosInfo;
176+
2: ShowTPJSystemFolders;
177+
3: ShowTPJOSInfo;
178+
4: ShowWin32Globals;
179+
end;
180+
end;
181+
182+
procedure TForm1.ShowTPJBiosInfo;
183+
const
184+
cWakeupTypes: array[TPJBIOSWakeupType] of string = (
185+
'wutReserved', 'wutOther', 'wutUnknown', 'wutAPMTimer', 'wutModemRing',
186+
'wutLANRemote', 'wutPowerSwitch', 'wutPCIPME', 'wutACPowerRestored'
187+
);
188+
189+
function FmtVersionWord(const V: Word): string;
190+
begin
191+
if V <> 0 then
192+
Result := Format('$%.4x (v%d.%d)', [V, V shr 8, V and $FF])
193+
else
194+
Result := 'Unknown or error';
195+
end;
196+
197+
function FmtDate(const D: TDate): string;
198+
var
199+
Fmt: TFormatSettings;
200+
begin
201+
// Use locale date format
202+
if SameDate(0.0, D) then
203+
Exit('Unknown or error');
204+
Fmt := TFormatSettings.Create;
205+
Result := FormatDateTime(Fmt.ShortDateFormat, D);
206+
end;
207+
208+
var
209+
BIOS: TPJBIOSInfo;
210+
begin
211+
sgBiosInfo.RowCount := 0;
212+
BIOS := TPJBIOSInfo.Create;
213+
try
214+
DisplayItem(sgBiosInfo, 'IsBIOSSupported', BIOS.IsBIOSSupported);
215+
DisplayItem(sgBiosInfo, 'SMBIOSSpecVersion',
216+
FmtVersionWord(BIOS.SMBIOSSpecVersion));
217+
DisplayItem(sgBiosInfo, 'BIOSVendor', BIOS.BIOSVendor);
218+
DisplayItem(sgBiosInfo, 'BIOSVersionStr', BIOS.BIOSVersionStr);
219+
DisplayItem(sgBiosInfo, 'BIOSVersion', FmtVersionWord(BIOS.BIOSVersion));
220+
DisplayItem(sgBiosInfo, 'BIOSECFirmwareVersion',
221+
FmtVersionWord(BIOS.BIOSECFirmwareVersion));
222+
DisplayItem(sgBiosInfo, 'BIOSReleaseDate [current locale]',
223+
FmtDate(BIOS.BIOSReleaseDate));
224+
DisplayItem(sgBiosInfo, 'BIOSReleaseDateInvariant',
225+
BIOS.BIOSReleaseDateInvariant);
226+
DisplayItem(sgBiosInfo, 'SystemUUIDRaw', BIOS.SystemUUIDRaw);
227+
DisplayItem(sgBiosInfo, 'SystemUUID [using GUIDToString]',
228+
GUIDToString(BIOS.SystemUUID));
229+
DisplayItem(sgBiosInfo, 'SystemUUIDStr(False)', BIOS.SystemUUIDStr(False));
230+
DisplayItem(sgBiosInfo, 'SystemUUIDStr(True)', BIOS.SystemUUIDStr(True));
231+
DisplayItem(sgBiosInfo, 'SystemManufacturer', BIOS.SystemManufacturer);
232+
DisplayItem(sgBiosInfo, 'SystemProductName', BIOS.SystemProductName);
233+
DisplayItem(sgBiosInfo, 'SystemFamily', BIOS.SystemFamily);
234+
DisplayItem(sgBiosInfo, 'SystemOEMVersion', BIOS.SystemOEMVersion);
235+
DisplayItem(sgBiosInfo, 'SystemSerialNumber', BIOS.SystemSerialNumber);
236+
DisplayItem(sgBiosInfo, 'SystemSKUNumber', BIOS.SystemSKUNumber);
237+
DisplayItem(sgBiosInfo, 'SystemWakeupType',
238+
cWakeupTypes[BIOS.SystemWakeupType]);
239+
finally
240+
BIOS.Free;
173241
end;
174242
end;
175243

Demos/VCL/FmDemo.dfm

14 Bytes
Binary file not shown.

Demos/VCL/FmDemo.pas

Lines changed: 87 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,17 @@ TDemoForm = class(TForm)
4343
procedure ShowTPJOSInfo;
4444
procedure ShowTPJComputerInfo;
4545
procedure ShowTPJSystemFolders;
46+
procedure ShowTPJBIOSInfo;
4647
end;
4748

4849
var
4950
DemoForm: TDemoForm;
5051

5152
implementation
5253

54+
uses
55+
DateUtils;
56+
5357
{$R *.DFM}
5458

5559
const
@@ -157,15 +161,79 @@ procedure TDemoForm.ShowContent(Tab: Integer);
157161
edDisplay.Clear;
158162
case Tab of
159163
0: ShowTPJComputerInfo;
160-
1: ShowTPJSystemFolders;
161-
2: ShowTPJOSInfo;
162-
3: ShowWin32Globals;
164+
1: ShowTPJBIOSInfo;
165+
2: ShowTPJSystemFolders;
166+
3: ShowTPJOSInfo;
167+
4: ShowWin32Globals;
163168
end;
164169
finally
165170
edDisplay.Lines.EndUpdate;
166171
end;
167172
end;
168173

174+
procedure TDemoForm.ShowTPJBIOSInfo;
175+
const
176+
cWakeupTypes: array[TPJBIOSWakeupType] of string = (
177+
'wutReserved', 'wutOther', 'wutUnknown', 'wutAPMTimer', 'wutModemRing',
178+
'wutLANRemote', 'wutPowerSwitch', 'wutPCIPME', 'wutACPowerRestored'
179+
);
180+
181+
function FmtVersionWord(const V: Word): string;
182+
begin
183+
if V <> 0 then
184+
Result := Format('$%.4x (v%d.%d)', [V, V shr 8, V and $FF])
185+
else
186+
Result := 'Unknown or error';
187+
end;
188+
189+
function FmtDate(const D: TDate): string;
190+
var
191+
Fmt: TFormatSettings;
192+
begin
193+
// Use locale date format
194+
if SameDate(0.0, D) then
195+
Exit('Unknown or error');
196+
Fmt := TFormatSettings.Create;
197+
Result := FormatDateTime(Fmt.ShortDateFormat, D);
198+
end;
199+
200+
var
201+
BIOS: TPJBIOSInfo;
202+
begin
203+
BIOS := TPJBIOSInfo.Create;
204+
try
205+
DisplayHeading('TPJBIOSInfo Methods');
206+
DisplayRuling;
207+
DisplayItem('IsBIOSSupported', BIOS.IsBIOSSupported);
208+
DisplayItem('SMBIOSSpecVersion', FmtVersionWord(BIOS.SMBIOSSpecVersion));
209+
DisplayRuling;
210+
DisplayItem('BIOSVendor', BIOS.BIOSVendor);
211+
DisplayItem('BIOSVersionStr', BIOS.BIOSVersionStr);
212+
DisplayItem('BIOSVersion', FmtVersionWord(BIOS.BIOSVersion));
213+
DisplayItem('BIOSECFirmwareVersion',
214+
FmtVersionWord(BIOS.BIOSECFirmwareVersion));
215+
DisplayItem('BIOSReleaseDate [current locale]',
216+
FmtDate(BIOS.BIOSReleaseDate));
217+
DisplayItem('BIOSReleaseDateInvariant', BIOS.BIOSReleaseDateInvariant);
218+
DisplayRuling;
219+
DisplayItem('SystemUUIDRaw', BIOS.SystemUUIDRaw);
220+
DisplayItem('SystemUUID [using GUIDToString]',
221+
GUIDToString(BIOS.SystemUUID));
222+
DisplayItem('SystemUUIDStr(False)', BIOS.SystemUUIDStr(False));
223+
DisplayItem('SystemUUIDStr(True)', BIOS.SystemUUIDStr(True));
224+
DisplayItem('SystemManufacturer', BIOS.SystemManufacturer);
225+
DisplayItem('SystemProductName', BIOS.SystemProductName);
226+
DisplayItem('SystemFamily', BIOS.SystemFamily);
227+
DisplayItem('SystemOEMVersion', BIOS.SystemOEMVersion);
228+
DisplayItem('SystemSerialNumber', BIOS.SystemSerialNumber);
229+
DisplayItem('SystemSKUNumber', BIOS.SystemSKUNumber);
230+
DisplayItem('SystemWakeupType', cWakeupTypes[BIOS.SystemWakeupType]);
231+
DisplayRuleOff;
232+
finally
233+
BIOS.Free;
234+
end;
235+
end;
236+
169237
procedure TDemoForm.ShowTPJComputerInfo;
170238
const
171239
cProcessors: array[TPJProcessorArchitecture] of string = (
@@ -177,22 +245,22 @@ procedure TDemoForm.ShowTPJComputerInfo;
177245
begin
178246
DisplayHeading('TPJComputerInfo Static Methods');
179247
DisplayRuling;
180-
DisplayItem('Computer Name', TPJComputerInfo.ComputerName);
181-
DisplayItem('User Name', TPJComputerInfo.UserName);
182-
DisplayItem('MAC Address', TPJComputerInfo.MACAddress);
183-
DisplayItem('Processor Count', Integer(TPJComputerInfo.ProcessorCount));
184-
DisplayItem('Processor Architecture', cProcessors[TPJComputerInfo.Processor]);
185-
DisplayItem('Processor Identifier', TPJComputerInfo.ProcessorIdentifier);
186-
DisplayItem('Processor Name', TPJComputerInfo.ProcessorName);
187-
DisplayItem('Processor Speed (MHz)', TPJComputerInfo.ProcessorSpeedMHz);
188-
DisplayItem('Is 64 Bit?', TPJComputerInfo.Is64Bit);
189-
DisplayItem('Is Network Present?', TPJComputerInfo.IsNetworkPresent);
190-
DisplayItem('Boot Mode', cBootModes[TPJComputerInfo.BootMode]);
191-
DisplayItem('Is Administrator?', TPJComputerInfo.IsAdmin);
192-
DisplayItem('Is UAC active?', TPJComputerInfo.IsUACActive);
193-
DisplayItem('BIOS Vender', TPJComputerInfo.BiosVendor);
194-
DisplayItem('System Manufacturer', TPJComputerInfo.SystemManufacturer);
195-
DisplayItem('System Product Name', TPJComputerInfo.SystemProductName);
248+
DisplayItem('ComputerName', TPJComputerInfo.ComputerName);
249+
DisplayItem('UserName', TPJComputerInfo.UserName);
250+
DisplayItem('MACAddress', TPJComputerInfo.MACAddress);
251+
DisplayItem('ProcessorCount', Integer(TPJComputerInfo.ProcessorCount));
252+
DisplayItem('Processor', cProcessors[TPJComputerInfo.Processor]);
253+
DisplayItem('ProcessorIdentifier', TPJComputerInfo.ProcessorIdentifier);
254+
DisplayItem('ProcessorName', TPJComputerInfo.ProcessorName);
255+
DisplayItem('ProcessorSpeedMHz', TPJComputerInfo.ProcessorSpeedMHz);
256+
DisplayItem('Is64Bit', TPJComputerInfo.Is64Bit);
257+
DisplayItem('IsNetworkPresent', TPJComputerInfo.IsNetworkPresent);
258+
DisplayItem('BootMode', cBootModes[TPJComputerInfo.BootMode]);
259+
DisplayItem('IsAdmin', TPJComputerInfo.IsAdmin);
260+
DisplayItem('IsUACActive', TPJComputerInfo.IsUACActive);
261+
DisplayItem('BiosVendor', TPJComputerInfo.BiosVendor);
262+
DisplayItem('SystemManufacturer', TPJComputerInfo.SystemManufacturer);
263+
DisplayItem('SystemProductName', TPJComputerInfo.SystemProductName);
196264
DisplayRuleOff;
197265
end;
198266

Docs/Acknowledgements.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ The project also draws on the work of:
2222

2323
* _**Richard MacCutchan**_ for the C++ code on which _TPJOSInfo.DecodedDigitalProductIDWin7AndDown_ is based. The code was posted on
2424
CodeProject by _enhzflep_ as Solution 4 at to the question ["How to get productId in windows 7 64 bit"](https://tinyurl.com/3n7fbt3h).
25+
26+
* _**Strive Sun**_ for the C code presented in his answer to the Stack Overflow post ["Win32 API to get Machine UUID"](https://tinyurl.com/cvbx792t). A Pascal translation of some of this code was used as a basis for the portions of the _TPJBiosInfo_ class.

0 commit comments

Comments
 (0)