0
votes

Im developing an application that would detect the DirectX versions installed on my system. For example if DirectX 9 and DirectX 11 are installed on my system then my program must detect these installations and display the installed versions. But I've no idea on how to accomplish this

EDIT: I dont want to use dxdiag UI to detect the versions, I want my program to detect the versions. And all installed versions must be detected not just the one that is pre-installed with the OS or the highest level supported by the OS

1
Such a program already exists on every Windows machine. Run dxdiag.exe to have a look-see. You can run it with the /x option to generate an .xml file instead.Hans Passant
Microsoft doesn't provide API for doing so. You should refer to the post mentioned by @Dale_dale12Asesh
Possible duplicate of Find out DirectX VersionAsesh
@Xlam Like I said there's no API to detect it. Vista comes with DirectX 10 which means DirectX 9 will be there too. Windows 10 comes DirectX 12 pre-installed which means DirectX 9 will be there too. You will have manually go through registry and files to detect them if you don't want to use feature levelsAsesh

1 Answers

2
votes

You'll most likely not be able to list all installed DirectX versions. I came across this interesting article in the support pages of the gaming platform called Steam:

Trying to manually check for the correct versions is extremely complicated because there are numerous files that must all be present and individual system configuration options like dll search paths complicate the situation. In addition, the dependencies and required checks may change in each new version of the D3DX runtime.

As mentioned by Hans Passant you can get the highest installed version by running dxdiag /x <output file> to generate an XML file containing various entries of your computer information, then parse or deserialize that file in your application.