Managed DirectX: Check if DirectX is installed

Started by
1 comment, last by data2 18 years, 4 months ago
Hi, Currently, I'm testing a DirectX application in C# on a blank WinXP system. After installing .NET 1.1 I get an TypeInitializationException, because DirectX cannot be found. Can I somehow check whether DirectX and the correct version is installed? I found an older thread, but it was for C++: http://www.gamedev.net/community/forums/topic.asp?topic_id=216273 And another question: First, I've installed the newest redistributable (October 2005) and the program crashed with the same exception. After I installed the June 2005 version, everything was fine. Why can't I use the newest version? I thought that the exact version is only imported when developing but not for the runtime. Isn't 9.0c runtime the same for all installation versions?
Advertisement
You could look into Microsoft.DirectX.Diagnostics. This set of api's helps you to programmably query the information that was gathered using the dxdiag tool. You could then make your assumptions from there. I will look into this as I cannot find the equavalent to the DirectSetup for native directx code.

I hope this helps.
Take care.
Ok, I see that I can iterate through the information about the system. I tink that will work. But the main problem: If no DirectX is installed, this will fail in the same way because the Assembly (microsoft.directx.diagnostics.dll) has to be loaded. Am I right here?

Can I somehow check whether the assemblies lay in the system's GAC (global assembly cache) That doesn't have to to anything with DirectX but with available assemblies in general? Then I might be able to determine if the assembly version is correct.

This topic is closed to new replies.

Advertisement