2

I am creating an installer which checks the registry for softwares/ components that are not installed and installs them if needed. The problem I am having is that the software I need to run launches correctly if I install the latest DirectX End-User Runtime from the DirectX End-User Runtime web installer on a fresh copy of Windows(http://www.microsoft.com/en-au/download/details.aspx?id=35).

The error I get if not installed is "The program can't start because d3dx9_43.dll is missing from your computer". Now even in a fresh install of windows, the DirectX registry entry from HKEY_LOCAL_MACHINE\Software\Microsoft\DirectX shows "4.09.00.0904" for the Version key.

So my question is, where do I look in the registry to check whether all components from the DirectX End-User Runtime are installed.

Really appreciate the help.

floyd1510
  • 391
  • 1
  • 6
  • 14
  • There's no real "registering" of all the dlls that are installed. They are simply extracted to the system32 folder and that's it (hence the only proper answer below). *On the other hand* though, after comparing the registry before and after the installation of the redist, I found out audio-related dlls get to register some CLSIDs too. If you were just to care about them (or if you aren't afraid of potential previous "[small installations](https://stackoverflow.com/a/26114130/5994170)") checking the registry for XAudio2_7's `5a508685-a254-4fba-9b82-9a24b00306af` may actually be doable. – mirh Mar 17 '20 at 01:42

1 Answers1

2

You didn't mention what installer, script, or programming language you were using. That would be helpful to know.

If you aren't worried about download size, the easiest thing might be to just always install the DirectX Runtime blindly. It won't hurt to install it if it's already there.

Here's some other things you can consider:

If you are on Vista or later (including Win7, Win8, Server 2K8), then you likely don't need to install anything. As these operating systems likely ship with the binary pre-installed. Ditto for XP SP2 and later. Is your "fresh copy of Windows" something newer than XP?

Another simple idea is to just search for the existence of d3dx9_43.dll in either the Windows\System32 or Windows\SysWow64 directory.

Programatically, you can have your Installer code detect for the installation of the DLL as follows

#include <windows.h>
BOOL HasD3DX9()
{
    HMODULE hMod = LoadLibrary("d3dx9_43.dll");
    return (hMOD != NULL) ? TRUE : FALSE;
}
selbie
  • 100,020
  • 15
  • 103
  • 173
  • 1
    Sorry I forgot to mention that I was building it in Python. But what you mentioned did help. Instead of checking the library I see if the dll file exists. – floyd1510 Aug 07 '12 at 04:35