I'm trying to get the list of physical printer's name, that are connected to Windows, based on an answer from Query available RAM in Inno Setup.
But just get: "Send To OneNote 16".
Here is my query:
Query := 'SELECT Name FROM Win32_Printer';
Printer := WbemQuery(WbemServices, Query);
if not VarIsNull(Printer) then
begin
Log(Format('Printers=%s', [Printer.Name]));
end;
You have to iterate the result set:
The code requires Unicode version of Inno Setup for a better
Variant
support.Actually, you can see this code in the same question, where you took the
WbemQuery
from:Is there a way to read the system's information in Inno Setup
Note how the
Win32_NetworkAdapterConfiguration
is iterated there.