1

I am trying to create an installer using NSIS and there is one custom page for checking hardware requirement. Currently, I am using the HwInfo plug-in, but the problem is the function GetVideoCardName only return 1 graphic card name even though the desktop has multiple graphic cards.

How can I get all installed graphic cards name using NSIS?

UPDATE:

I use WMI header to get all graphic cards name.

If anyone has better option, please tell me.

currarpickt
  • 2,290
  • 4
  • 24
  • 39
  • Why do you need to know? Are you installing a game and want to verify some performance requirements? – Anders Aug 27 '14 at 19:14
  • The installer should only run if there is a VGA add-on. But, there is a possibility that several desktops might have multiple VGAs add-on. – currarpickt Aug 28 '14 at 03:02

2 Answers2

0

You probably need to write your own custom plugin or modify the HwInfo plugin.

If you are installing a game you might want to take a look at DirectDrawEnumerateEx and similar functions or perhaps EnumDisplayDevices for devices at the GDI level.

Anders
  • 97,548
  • 12
  • 110
  • 164
0

In addition to Anders answer: I thought the same - it is not so difficult to adapt the HwInfo plugin. What do you need to do?

  1. The sourcecode is available at the HwInfo page
  2. From the sourcecode you see that the method GetVideoCardName() (in NSISFunctions.cpp) calls the GetVideoAdapterDescription() method in HardwareInfo.cpp.
  3. Now you need to iterate the graphic cards and return an array. For some inspiration on how to do that check this.
  4. Compile and create a new DLL version
  5. Create a new version and add a readme (with a description, credits etc.)
  6. Register or login to nsis, and upload the new version and update the page itself

It is worth to contribute (i contributed to nsis in the past) since everybody benefits.

Lonzak
  • 9,334
  • 5
  • 57
  • 88