SWbemServicesEx Innosetup

186 views Asked by At

I have made an installer for my program with Inno Setup and it has been worked fine so far, but it gives error in one system : (The system is Win7-64 bit)

SWbemServicesEx: Generic failure

The code is :

WbemLocator := CreateOleObject('WbemScripting.SWbemLocator');
WbemServices := WbemLocator.ConnectServer('.', 'root\CIMV2');
QueryGPU := 'SELECT * FROM  Win32_VideoController';
WbemObjectSet := WbemServices.ExecQuery(QueryGPU);
if not VarIsNull(WbemObjectSet) then
begin
  NetworkAdapter := WbemObjectSet.ItemIndex(0);
  uuG :=  NetworkAdapter.PNPDeviceID;
end;
  • The error occurs at this line:

WbemObjectSet := WbemServices.ExecQuery(QueryGPU);

1

There are 1 answers

0
bahman jafari On

The problem has been resolved after removing Graphic driver. I think graphic driver didn't allow to run query.