PDA

View Full Version : SysInfo DLL Plugin


BLACKFIRE69
11-04-2020, 04:26
System Information Inno Library


Cpu
- Name
- Cores
- Threads
- Speed
- Usage


Gpu
- Name
- Memory
- DirectX Version


Os
- Name
- Architecture
- ID
- Build Number
- OS Major
- OS Minor
- ServicePack Major
- ServicePack Minor


Ram
- Available
- Total
- Usage


Screen
- Resolution
- Refresh Rate


Space
- Total
- Free


Username
- Account Name


Sound
- Sound Card Name





For Inno Setup 6.0 or newer:
Example for Inno Setup 6.0 or newer (https://fileforums.com/showpost.php?p=486211&postcount=54)




------------------------------------------------------------------------------

Cesar82
11-04-2020, 15:53
Very good...
- If possible you should use an older version of the compiler (If created in Delphi use DELPHI 2010).
A smaller file will be generated (2.84 MB is very large and is already compressed in UPX). The ISSysInfo by Peterf1999 library is only 254Kb (compressed UPX).
- If possible put an example compatible with Inno Setup (Standard) in your example script. Not everyone uses the EE version of Inno Setup (The EE version is obsolete).

Thanks for library.

BLACKFIRE69
12-04-2020, 01:08
Very good...
- If possible you should use an older version of the compiler (If created in Delphi use DELPHI 2010).
A smaller file will be generated (2.84 MB is very large and is already compressed in UPX). The ISSysInfo by Peterf1999 library is only 254Kb (compressed UPX).
- If possible put an example compatible with Inno Setup (Standard) in your example script. Not everyone uses the EE version of Inno Setup (The EE version is obsolete).

Thanks for library.

i will try with "DELPHI 2010".

thanks...

bunti_o4u
12-04-2020, 08:11
To reduce the file size, as Cesar82 said, recompiled the source code using "Delphi 2010".

Final Size : SysInfo.dll - 302 kb

Observed three issues. you may choose to fix
01. it is showing GPU name and memory as weird numbers. GPU description is Zotac rtx 2070 super 8GB.
02. 9700k has 8 cores and 8 threads but it is showing as 4 cores and 8 threads.
03. It is showing RAM as 8GB though my pc has 16GB of RAM

KaktoR
12-04-2020, 12:16
Same here (GPU + RAM is wrong)

If you need something special let us know.

BLACKFIRE69
12-04-2020, 12:30
Same here (GPU + RAM is wrong)

If you need something special let us know.

ya i got it. that would be correct. thnx..

Cesar82
12-04-2020, 16:56
https://i.imgur.com/h5yiwFk.jpg

To correct the CPU name, you can try replacing PAnsiChar with WideString in your SysInfo source code.
Original:
function GetGPUName : PAnsiChar;
Replace by:
function GetGPUName : WideString;

I don't know if it will fix it, but as PAnsiChar doesn't support wide characters this error happens.

Or you can convert your code to ANSI using:
Result: = PAnsiChar (AnsiString (Utf8ToUnicodeString (strSource)));

Thanks for the smaller size update.

bunti_o4u
12-04-2020, 19:50
ya i got it. that would be correct. thnx..

Noted one more thing. it is showing available RAM and Total RAM as 2047MB and 8192MB respectively in all three screenshots i.e. KaktoR, Cesar82 and mine.

Cesar82
25-04-2020, 09:16
@BLACKFIRE69

Error in VRAM (GTX 970 = 4 GB VRAM):

Result:
GPU Memory = -1 MB

The detected RAM was 31.96 GB and windows detects 32.00 GB (Maybe windows rounds the value)

Gupta
26-04-2020, 03:30
you should check wmi
https://docs.microsoft.com/en-us/windows/win32/wmisdk/about-wmi
https://github.com/jagannatharjun/installer/blob/ac344eba46791ce41b11b35ae3bac3528edbcdf9/Wmi_Object.cpp#L193
https://github.com/jagannatharjun/installer/blob/ac344eba46791ce41b11b35ae3bac3528edbcdf9/tinstallerinfo.cpp#L378

Jiva newstone
28-04-2020, 09:33
@BLACKFIRE69
any Difference in Xtimer like its a settimer or any kind of multi threaded time..
and also weird - sign in gpu ram

BLACKFIRE69
28-04-2020, 16:50
@BLACKFIRE69
any Difference in Xtimer like its a settimer or any kind of multi threaded time..
and also weird - sign in gpu ram

Xtimer is just a timer.

yup VRam ... 🤕

Jiva newstone
28-04-2020, 20:12
Xtimer is just a timer.

yup VRam ... 🤕

i used your dll in my installer, stills its an error, so iam using stringchange to remove- or replace - with 0
plz fix it soon :)

BLACKFIRE69
29-04-2020, 10:37
i used your dll in my installer, stills its an error, so iam using stringchange to remove- or replace - with 0
plz fix it soon :)

ok 👍

bunti_o4u
18-05-2020, 10:06
SysInfo DLL - Test 2


guys, test this plz, the new test DLL;

SysInfo_Test_2.rar (https://drive.google.com/file/d/1LS39fW7jnuhOatpRujSzmjMSZtjJDU-m/view?usp=sharing)

thanks to Cesar82, Jiva newstone, Razor12911, ... who helping me out here.

GPU RAM Size - showing 4GB instead of 8GB.

Cesar82
18-05-2020, 15:34
GPU RAM Size - showing 4GB instead of 8GB.
What is your video card installed?

Razor12911
18-05-2020, 18:27
What is your video card installed?


GPU description is Zotac rtx 2070 super 8GB.



SysInfo DLL - Test 2


guys, test this plz, the new test DLL;

SysInfo_Test_2.rar (https://drive.google.com/file/d/1LS39fW7jnuhOatpRujSzmjMSZtjJDU-m/view?usp=sharing)

thanks to Cesar82, Jiva newstone, Razor12911, ... who helping me out here.

same, shows 4GB instead of 6GB. GTX 1060

Cesar82
18-05-2020, 18:38
SysInfo DLL - Test 2


guys, test this plz, the new test DLL;

SysInfo_Test_2.rar (https://drive.google.com/file/d/1LS39fW7jnuhOatpRujSzmjMSZtjJDU-m/view?usp=sharing)

thanks to Cesar82, Jiva newstone, Razor12911, ... who helping me out here.
Here it worked OK using Inno Setup 6.04.
The script file for testing with Inno Setup 6 is attached.
https://i.imgur.com/Y5y2adK.png

Razor12911
18-05-2020, 18:43
Maybe you'll figure out what the issue is :)

Cesar82
18-05-2020, 22:16
Maybe you'll figure out what the issue is :)
It is not a unique GUI, Here is:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Video\
{0F559AFC-6CB8-11EA-908D-446D5762B1A6}\0000

Please check if this key exists in your system.
This key I found here, and in my system it is the same. (https://superuser.com/questions/1461858/fetch-correct-vram-for-gpu-via-command-line-on-windows)
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Cl ass\{4d36e968-e325-11ce-bfc1-08002be10318}\0000

Cesar82
18-05-2020, 23:50
Test vRAM from registry...
If you have 2 or more video cards, the highest vRAM value will be displayed (if it is working correctly).

BLACKFIRE69
19-05-2020, 04:48
Test vRAM from registry...
If you have 2 or more video cards, the highest vRAM value will be displayed (if it is working correctly).

in my case,

is always zero.

https://i.imgur.com/CWVGYaR.png

Cesar82
19-05-2020, 05:23
in my case,

is always zero.
Run regedit and check if the registry key exists on your system:
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Cl ass\{4d36e968-e325-11ce-bfc1-08002be10318}\0000
and
VALUE = HardwareInformation.qwMemorySize
and
VALUE = HardwareInformation.MemorySize

Gupta
19-05-2020, 05:29
bro just use wmi, you'll require class - win32_VideoController property - AdapterRAM

or if you want to play lazy, you can just parse the output of this

wmic path win32_VideoController get AdapterRAM

BLACKFIRE69
19-05-2020, 05:37
Run regedit and check if the registry key exists on your system:
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Cl ass\{4d36e968-e325-11ce-bfc1-08002be10318}\0000
and
VALUE = HardwareInformation.qwMemorySize
and
VALUE = HardwareInformation.MemorySize


only HardwareInformation.MemorySize.

https://i.imgur.com/0j99te6.png

Cesar82
19-05-2020, 06:49
only HardwareInformation.MemorySize.

try now.

BLACKFIRE69
19-05-2020, 07:58
try now.

works... :D

Cesar82
19-05-2020, 15:47
bro just use wmi, you'll require class - win32_VideoController property - AdapterRAM

or if you want to play lazy, you can just parse the output of this

wmic path win32_VideoController get AdapterRAM

Does not work for video cards over 4 GB look at win32_VideoController (https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-videocontroller)
uint32 AdapterRAM;
uint32 = unsigned integer 32 bits = 2^32 = 4294967296 bytes = 4 GB

Razor12911
20-05-2020, 00:39
Another method is to use OpenCL but I do not recommend it unless if you really want to know more about the GPU, such as clock speeds or to use the GPU for other purposes.
They have an example and it detects GPU memory correctly as well.
https://code.google.com/archive/p/delphi-opencl/downloads

felice2011
20-05-2020, 02:11
They have an example and it detects GPU memory correctly as well.
https://code.google.com/archive/p/delphi-opencl/downloads

Come on don't overdo it ....:D:p

is hungry a few GB on my old PC

https://i.ibb.co/CzsqD4t/VGA.png

Razor12911
20-05-2020, 09:52
Come on don't overdo it ....:D:p

is hungry a few GB on my old PC

https://i.ibb.co/CzsqD4t/VGA.png

I only noticed this alternative when I was trying to allocate memory in GPU instead of ram to see what will happen with my programs :p

felice2011
20-05-2020, 10:06
I only noticed this alternative when I was trying to allocate memory in GPU instead of ram to see what will happen with my programs :p

I personally think it's too much information, most of it unnecessary to include in an installation or other. perhaps for other information purposes on hardware or software yes.:confused:

Razor12911
20-05-2020, 10:48
I personally think it's too much information, most of it unnecessary to include in an installation or other. perhaps for other information purposes on hardware or software yes.:confused:

I do not recommend it unless if you really want to know more about the GPU, such as clock speeds or to use the GPU for other purposes.

Well I did say

Cesar82
20-05-2020, 16:55
I think a reading version of the registry does not work properly if you don't have a video card.
I created a version with both options in inno setup, if the result of the WMI verification is less than 0 (Negative value) it checks the registry.

DiCaPrIo
29-05-2020, 04:19
guys,
test this plz :D

VRam: 17592186044415 MB :eek:

Cesar82
29-05-2020, 04:55
VRam: 17592186044415 MB :eek:
Also here.

Razor12911
29-05-2020, 05:20
VRam: 17592186044415 MB :eek:

Me wondering if this would be enough for Crysis Remastered :rolleyes:

my god! :eek:

this may fix, plz test too.

GpuName: Intel(R) HD Graphics 4600
VRam: 1024 MB

My GTX 1060 not detected and these Intel garbage graphics are also 128MB, not 1024MB

BLACKFIRE69
29-05-2020, 05:25
Me wondering if this would be enough for Crysis Remastered :rolleyes:


yup 😎

BLACKFIRE69
29-05-2020, 05:38
GpuName: Intel(R) HD Graphics 4600
VRam: 1024 MB


i am making progress... :cool: :D


My GTX 1060 not detected and these Intel garbage graphics are also 128MB, not 1024MB


Usually this is shown (128 or 512 --> 1 GB). :rolleyes:

DiCaPrIo
29-05-2020, 05:54
GpuName: NVIDIA GeForce GTX 1060 6GB
VRam: -1 MB
use Int64

Razor12911
29-05-2020, 06:27
I wonder what it is that you're doing wrong bro but here is another place in regedit where you can get GPU info for all GPUs installed.

Cesar82
30-05-2020, 05:21
I wonder what it is that you're doing wrong bro but here is another place in regedit where you can get GPU info for all GPUs installed.
This subject is also of interest, so I ask questions.
This GUID is variable from system to system.
Here there are 6 GUIDs with DedicatedVideoMemory values, one of which is from the ON-BOARD video card.
But the GUID bears no resemblance to those of your images.
https://i.imgur.com/vXXrx3Z.png
How to identify the correct GUID to obtain the video value?
Would this method work with older operating systems like WindowsXP or Vista, 7, etc?

I could make a list and search all GUIDs until I found a value other than 0, but how do I know if it would be the correct GUID?
The value in DedicatedVideoMemory is not correct here.
It should be 4 GB but it results 4239917056 = 4043.5 MB = 3.94 GB.

Razor12911
30-05-2020, 17:23
This subject is also of interest, so I ask questions.
This GUID is variable from system to system.
Here there are 6 GUIDs with DedicatedVideoMemory values, one of which is from the ON-BOARD video card.
But the GUID bears no resemblance to those of your images.
https://i.imgur.com/vXXrx3Z.png
How to identify the correct GUID to obtain the video value?


I decided to check where these values really came from
SOFTWARE\Microsoft\DirectX\ - DirectX is a clue so one has to go on msdn
which is here
https://docs.microsoft.com/en-us/windows/win32/api/dxgi/ns-dxgi-dxgi_adapter_desc
https://stackoverflow.com/questions/56587671/visual-basic-find-gpu-dedicated-memory-nvidia-or-amd/56599035

Also found this Visual Basic code so I translated it to pascal so here


uses
Winapi.Windows, Winapi.DXGI;

type
TGPUInfo = record
FName: String;
FSize: Integer;
end;

TGPUs = array of TGPUInfo;

procedure GetGPUs(out V: TGPUs);
function Align(Value, Size: Integer): Integer;
begin
if Value mod Size <> 0 then
Result := Succ(Max(0, Value div Size)) * Size
else
Result := Value;
end;

var
GPUInfo: TGPUInfo;
i: Integer;
riid: TGUID;
hr: HRESULT;
pFactory: IDXGIFactory;
pAdapter: IDXGIAdapter;
dxAdapterDesc: DXGI_ADAPTER_DESC;
begin
riid := StringToGUID('{7b7166ec-21c7-44ae-b21a-c9ae321ae369}');
pFactory := nil;
hr := CreateDXGIFactory(riid, pFactory);
if (hr = S_OK) and Assigned(pFactory) then
begin
pAdapter := nil;
i := 0;
while (pFactory.EnumAdapters(i, pAdapter) = S_OK) do
begin
FillChar(dxAdapterDesc, SizeOf(DXGI_ADAPTER_DESC), 0);
hr := pAdapter.GetDesc(dxAdapterDesc);
if hr = S_OK then
begin
GPUInfo.FName := dxAdapterDesc.Description;
GPUInfo.FSize := IfThen(dxAdapterDesc.DedicatedVideoMemory = 0,
dxAdapterDesc.DedicatedSystemMemory,
dxAdapterDesc.DedicatedVideoMemory) div 1048576;
GPUInfo.FSize := Align(GPUInfo.FSize, IfThen(GPUInfo.FSize < 512,
32, 512));
Insert(GPUInfo, V, Length(V));
end;
inc(i);
end;
end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
i: Integer;
MyGPUs: TGPUs;
begin
GetGPUs(MyGPUs);
for i := Low(MyGPUs) to High(MyGPUs) do
ShowMessage(MyGPUs[i].FName + ' (' + MyGPUs[i].FSize.ToString + ' MB)');
end;

Would this method work with older operating systems like WindowsXP or Vista, 7, etc?
This works using DXGI which was introduced in Windows Vista.


The value in DedicatedVideoMemory is not correct here.
It should be 4 GB but it results 4239917056 = 4043.5 MB = 3.94 GB.

Actually it is correct, open task manager and you'll see why it is 3.94 GB, I added the align function to help with rounding off 4044 to 4096

Cesar82
30-05-2020, 18:44
@Razor12911
If possible, share the compiled executable for me to check here.

I changed the code to use with Delphi 2010 (I only have this version installed), but in the Delphi 2010 version it does not have uses DXGI, so I include this DXGI from the link (https://github.com/CMCHTPC/DelphiDX12/blob/master/Units/DX12.DXGI.pas)

The results here were well below what should be displayed (3584 MB).And in the second result he detected "Microsoft Basic Render Driver (0 MB)"

I don't know if I did something wrong or the DXGI I used doesn't work, so if possible share the exe for me to compare.
Thanks!

Razor12911
30-05-2020, 18:51
there

edit: something I'm only realizing now XD, this method might have issues because it is SIZE_T that is being used which is an equivalent to NativeInt in Delphi.

NativeInt in x86 is actually a 32-bit integer, however this can be fixed by merging this code to the same idea I shared earlier about the same info being available on registry here (https://fileforums.com/showpost.php?p=486085&postcount=45)

Cesar82
30-05-2020, 19:09
You have correctly displayed the value of the main video card.
https://i.imgur.com/RsCj6ED.png
Did not detect Intel (R) HD Graphics 4000
https://i.imgur.com/p8fz5yS.png

Did something go wrong with my adaptation?
Or maybe the DXGI I used doesn't work for that.
uses
Windows, DXGI;
//DXGI from link (https://github.com/CMCHTPC/DelphiDX12/blob/master/Units/DX12.DXGI.pas)

type
TGPUInfo = record
FName: String;
FSize: Integer;
end;

TGPUs = array of TGPUInfo;

procedure GetGPUs(out V: TGPUs);
function Max(A, B: Integer): Integer;
begin
if A > B then
Result := A
else
Result := B;
end;
function Align(Value, Size: Integer): Integer;
begin
if Value <> 0 then
Result := (Max(0, Value div Size) + 1) * Size
else
Result := Value;
end;
var
GPUInfo: TGPUInfo;
i: Integer;
riid: TGUID;
hr: HRESULT;
pFactory: IDXGIFactory;
pAdapter: IDXGIAdapter;
dxAdapterDesc: TDXGI_ADAPTER_DESC;
begin
riid := StringToGUID('{7b7166ec-21c7-44ae-b21a-c9ae321ae369}');
pFactory := nil;
hr := CreateDXGIFactory(riid, pFactory);
if (hr = S_OK) and Assigned(pFactory) then
begin
pAdapter := nil;
i := 0;
while (pFactory.EnumAdapters(i, pAdapter) = S_OK) do
begin
FillChar(dxAdapterDesc, SizeOf(TDXGI_ADAPTER_DESC), 0);
hr := pAdapter.GetDesc(dxAdapterDesc);
if hr = S_OK then
begin
GPUInfo.FName := dxAdapterDesc.Description;

if dxAdapterDesc.DedicatedVideoMemory = 0 then
GPUInfo.FSize := dxAdapterDesc.DedicatedSystemMemory div 1048576
else
GPUInfo.FSize := dxAdapterDesc.DedicatedVideoMemory div 1048576;

if GPUInfo.FSize < 512 then
GPUInfo.FSize := Align(GPUInfo.FSize, 32)
else
GPUInfo.FSize := Align(GPUInfo.FSize, 512);

SetLength(V, Length(V) + 1);
V[Length(V) - 1] := GPUInfo;
end;
Inc(i);
end;
end;
end;

procedure TForm2.Button1Click(Sender: TObject);
var
i: Integer;
MyGPUs: TGPUs;
begin
GetGPUs(MyGPUs);
for i := Low(MyGPUs) to High(MyGPUs) do
ShowMessage(MyGPUs[i].FName + ' (' + IntToStr(MyGPUs[i].FSize) + ' MB)');
end;

felice2011
31-05-2020, 03:26
I don't understand the basics are here https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-videocontroller in the WMI class, because used DX structures, also I think that only the primary vga that is used is of interest.


Name_GPU.Text = "GPU Name : " & GPU_Name()
Ram_Adapter.Text = "VGA Memory : " & Format_Bytes(AdapterRAM)

...

Private Function GPU_Name() As String
'Info GPU
Dim Name_GPU As String = ""
Dim GPU As New ManagementObjectSearcher("SELECT Name FROM Win32_VideoController")
For Each Info_GPU As ManagementObject In GPU.Get()
Try
Name_GPU = Info_GPU("Name").ToString()
Exit For
Catch ex As Exception
Name_GPU = "?"
End Try
Next
Return Name_GPU
End Function

Private Function AdapterRAM() As String
'Info GPU
Dim Adapter_RAM As String = ""
Dim GPU As New ManagementObjectSearcher("SELECT AdapterRAM FROM Win32_VideoController")
For Each Info_GPU As ManagementObject In GPU.Get()
Try
Adapter_RAM = Info_GPU("AdapterRAM").ToString()
Exit For
Catch ex As Exception
Adapter_RAM = "?"
End Try
Next
Return Adapter_RAM
End Function

Private Function Format_Bytes(ByVal Bytes_Convert As String) As String
Dim Total_Convert As Double
Try
Select Case Bytes_Convert
'Case Is >= 1073741824 'GB
' Total_Convert = CDbl(Bytes_Convert / 1073741824) 'GB
' Return FormatNumber(Total_Convert, 2) & " GBytes"
Case Is >= 1048576 'To 1073741823
Total_Convert = CDbl(Bytes_Convert / 1048576) 'MB
Return FormatNumber(Total_Convert, 0) & " MBytes"
Case 1024 To 1048575
Total_Convert = CDbl(Bytes_Convert / 1024) 'KB
Return FormatNumber(Total_Convert, 0) & " KBytes"
Case 0 To 1023
Total_Convert = Bytes_Convert 'Bytes
Return FormatNumber(Total_Convert, 0) & " Bytes"
Case Else
Return ""
End Select
Catch
Return ""
End Try
End Function

Cesar82
31-05-2020, 05:48
I don't understand the basics are here https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-videocontroller in the WMI class, because used DX structures, also I think that only the primary vga that is used is of interest.

WMI class ( AdapterRAM ) does not support video cards over 4 GB.
Only for that reason the matter continues.

Razor12911
31-05-2020, 06:02
try this one, you can remove the DXGI code if you having issues and just use the registry. Should produce the same results.

uses
Winapi.Windows, Winapi.DXGI, System.Win.Registry;

type
TGPUInfo = record
FName: String;
FSize: Integer;
end;

TGPUs = array of TGPUInfo;

procedure GetGPUs(out V: TGPUs; UseDXGI: Boolean);
function Align(Value, Size: Integer): Integer;
begin
if Value mod Size <> 0 then
Result := Succ(Max(0, Value div Size)) * Size
else
Result := Value;
end;

const
RegPath = 'SOFTWARE\Microsoft\DirectX\';
var
GPUInfo: TGPUInfo;
i, j, k, l: Integer;
x: Int64;
riid: TGUID;
hr: HRESULT;
pFactory: IDXGIFactory;
pAdapter: IDXGIAdapter;
dxAdapterDesc: DXGI_ADAPTER_DESC;
Reg1: TRegIniFile;
Reg2: TRegistry;
SL: TStringList;
mybool: Boolean;
begin
Reg1 := TRegIniFile.Create(KEY_READ or KEY_WOW64_64KEY);
SL := TStringList.Create;
Reg1.RootKey := HKEY_LOCAL_MACHINE;
if Reg1.OpenKey(RegPath, False) then
Reg1.ReadSections(SL);
Reg1.Free;
Reg2 := TRegistry.Create(KEY_READ or KEY_WOW64_64KEY);
Reg2.RootKey := HKEY_LOCAL_MACHINE;
if UseDXGI then
begin
riid := StringToGUID('{7b7166ec-21c7-44ae-b21a-c9ae321ae369}');
pFactory := nil;
hr := CreateDXGIFactory(riid, pFactory);
if (hr = S_OK) and Assigned(pFactory) then
begin
pAdapter := nil;
i := 0;
while (pFactory.EnumAdapters(i, pAdapter) = S_OK) do
begin
FillChar(dxAdapterDesc, SizeOf(DXGI_ADAPTER_DESC), 0);
hr := pAdapter.GetDesc(dxAdapterDesc);
if hr = S_OK then
begin
GPUInfo.FName := dxAdapterDesc.Description;
GPUInfo.FSize := IfThen(dxAdapterDesc.DedicatedVideoMemory = 0,
dxAdapterDesc.DedicatedSystemMemory,
dxAdapterDesc.DedicatedVideoMemory) shr 20;
if dxAdapterDesc.DedicatedSystemMemory = 0 then
for j := 0 to SL.Count - 1 do
begin
if Reg2.OpenKey(RegPath + SL[j], False) then
begin
if (Reg2.ReadString('Description') = GPUInfo.FName) then
if Reg2.ReadBinaryData('DedicatedVideoMemory', x, x.Size) = x.Size
then
begin
GPUInfo.FSize := x shr 20;
break;
end;
Reg2.CloseKey;
end;
end;
GPUInfo.FSize := Align(GPUInfo.FSize, IfThen(GPUInfo.FSize < 512,
32, 512));
Insert(GPUInfo, V, Length(V));
end;
inc(i);
end;
end;
end;
for j := 0 to SL.Count - 1 do
begin
if Reg2.OpenKey(RegPath + SL[j], False) then
begin
mybool := True;
for i := Low(V) to High(V) do
begin
if (Reg2.ReadString('Description') = V[i].FName) then
begin
mybool := False;
break;
end;
end;
if mybool then
begin
GPUInfo.FName := Reg2.ReadString('Description');
x := 0;
if Reg2.ReadBinaryData('DedicatedVideoMemory', x, x.Size) = x.Size then
x := x shr 20;
if x = 0 then
if Reg2.ReadBinaryData('DedicatedSystemMemory', x, x.Size) = x.Size
then
x := x shr 20;
GPUInfo.FSize := x;
GPUInfo.FSize := Align(GPUInfo.FSize, IfThen(GPUInfo.FSize < 512,
32, 512));
Insert(GPUInfo, V, Length(V));
end;
end;
Reg2.CloseKey;
end;
SL.Free;
Reg2.Free;
for i := Low(V) to High(V) do
begin
k := 0;
for j := Low(V) to High(V) do
if V[j].FSize >= k then
begin
k := V[i].FSize;
l := j
end;
GPUInfo := V[i];
V[i] := V[l];
V[l] := GPUInfo;
end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
i: Integer;
MyGPUs: TGPUs;
begin
Memo1.Lines.Clear;
GetGPUs(MyGPUs, True);
for i := Low(MyGPUs) to High(MyGPUs) do
Memo1.Lines.Add(MyGPUs[i].FName + ' (' + MyGPUs[i].FSize.ToString + ' MB)');
end;

Cesar82
31-05-2020, 20:33
Thanks @Razor12911

I just didn't understand one thing ...
In your code above, the registration information overlaps the GDXI values (if parametter UseDXGI = true).
Shouldn't there be an "end else" in place of "end;"?
inc(i);
end;
end;
end else
for j := 0 to SL.Count - 1 do
begin

If someone using older versions of Delphi, I attached the example of Razor12911 adapted for Delphi 2010.
Thanks again Razor12911 for the code, it's working perfectly, especially the version using registry that also detects the ON-BOARD video card.

Razor12911
01-06-2020, 01:06
I made it to work like that for a reason. Remember you said your intel you was not detected. So after dxgi is done detecting gpus using its methods, if any gpus were missed then registry code adds the remaining gpus. This is why I didn’t use “else”.
But then you might say why not just get rid of dxgi if doesn’t detect all gpus.

Here is why, registry skips gpus with names that have already been detected which means if SLi/Crossfire was used, registry method will not be able to detect this but dxgi will be able to.
While dxgi has issues of detecting intel gpu, registry helps dxgi
Plus we have no idea if the same registry idea works on older operating systems so it’s best to have both methods working together

So you can see why both code have to exist because they nullify the disadvantages they both have, furthermore. Dxgi has issues detecting gpu size in x86 because the value type used in x86 has the same issue as with wmi adapterram where gpu over 4gb is misread.

Tl;dr both code help mitigate their own disadvantages so the code works flawlessly

Cesar82
01-06-2020, 08:04
@Razor12911
Now I understand. Thanks!
There will only be differences in the results checking or not DXGI if you use SLI/Crossfire.

BLACKFIRE69
07-06-2020, 06:05
SysInfo Library 2


Added:

CheckIsAdmin
CheckIs64Bit

GetOSVersionMajor
GetOSVersionMinor
GetServicePackMajorVersion
GetServicePackMinorVersion

DirectX Version
SoundCardName


Thanks Cesar82, Razor12911 ... who helped.

Cesar82
07-06-2020, 09:19
SysInfo Library 2
Added:

CheckIsAdmin
CheckIs64Bit

GetOSVersionMajor
GetOSVersionMinor
GetServicePackMajorVersion
GetServicePackMinorVersion

DirectX Version
SoundCardName

Thanks Cesar82, Razor12911 ... who helped.
Thanks @BLACKFIRE69!
It seems to be working perfectly.

For those who have Inno Setup 6 installed and do not have the knowledge to change the script and want to do the test, I attached to this post the script adapted for Inno Setup 6.0 or newer.

bunti_o4u
07-06-2020, 23:20
SysInfo Library 2

Added:

DirectX Version


retrieving directX version makes the setup to take more time then if directX is not added in script. pl look into it.

BLACKFIRE69
08-06-2020, 00:48
retrieving directX version makes the setup to take more time then if directX is not added in script. pl look into it.

got it... 👍

bunti_o4u
08-06-2020, 01:48
got it... 👍

Soundcard is Realtek high definition audio but it is showing Nvidia high definition audio.

DiCaPrIo
08-06-2020, 02:06
Soundcard is Realtek high definition audio but it is showing Nvidia high definition audio.

did you plugin your woofer or earphone

bunti_o4u
08-06-2020, 02:25
did you plugin your woofer or earphone

Headphones are always plugged in and working properly.

DiCaPrIo
08-06-2020, 03:06
Headphones are always plugged in.

test your headphones if its really working
as I have same problem whenever I unplugin my earphone it shows

KaktoR
08-06-2020, 09:33
Works fine here :p

Harsh ojha
09-06-2020, 05:19
Perfect
(Low End Pc)

bundy-al
17-03-2021, 09:45
Hi is there anyone here on the forum that WILL help me.
I have asked 3 people but no one wants to help.
Who can change the script from Project1 or SysInfo DLL 2 and make it into a batch script ?

Project1 you have to click on a button first to read the GPU Memory, I want the GPU Memory to be read and saved on the desktop as .txt and the script preferably as a batch file.

SysInfo DLL 2 also looks good, but only read out and save as .txt with a batch script.
Now it's a setup and you have to click Next, I don't want to see a fixed screen at all.


This would also be nice in a batch file.

Detecting Graphics Adapter Data

Basic Graphics Information

Adapter 1 Description : NVidia RTX 2070 Super
Adapter 1 Video Memory : 8.00 GB [Rounded Value].
Adapter 1 Driver Date : 2021-02-23
Adapter 1 Driver Version : 27.21.14.6172
Adapter 1 Bits Per Pixel : 32
Adapter 1 Video Mode Desc : 1920 x 1080 x 4294967296 colors

Adapter 2 Intel(R) HD Graphics 4600 (128 MB)
Adapter 2 Video Memory : 128 MB [Rounded Value]
Adapter 2 Driver Date : 2021-02-23
Adapter 2 Driver Version : 27.21.14.6172
Adapter 2 Bits Per Pixel : 32
Adapter 2 Video Mode Desc : 1920 x 1080 x 4294967296 colors

And if that's not possible, then just this,

Adapter 1 Description : NVidia RTX 2070 Super
Adapter 1 Video Memory : 8.00 GB [Rounded Value]
Adapter 2 Intel(R) HD Graphics 4600 (128 MB)
Adapter 2 Video Memory : 128 MB [Rounded Value]

Display this script with read in and then save it to the desktop as a .txt

Please message back if you are willing and able to make this batch script for me please, if you have the time.
Then you are the best for me.

Best regards

Lord.Freddy
03-09-2022, 23:40
1) Your dll was very good, but in the [ANSI] version, (Free Space) and (Total Space), it shows the disk size incorrectly.

2) Not working on windowsXP (X86)/(X64)