Scythen

With the newer versions of DirectX there are several different D3DX dlls that exist. Just checking for DirectX version 9.0c is not sufficent as that version contains several revisions of the D3DX dlls. If a game ships with the April release the earlier versions of DirectX 9.0c will not work.

How can the exact installed version be determined



Re: Game Technologies: General How to detect version of D3DX installed?

Ross Ridge

A game that uses the April 2006 version of the D3DX DLL should include the DirectX End-User Runtime from the April 2006 SDK and uncondionally install it during the game's install procedure. If including the entire runtime is too much of a burden (eg. for ansmall web download game) then are ways to reduce to the runtime install to just the necessary D3DX DLL to save space. Alternatively, you can point users at Microsoft's WWW page and have them download and install the runtime containing the DLL.

If you need to check to see if the April 2006 D3DX DLL has been installed in order to verify that DirectX has been installed correctly by one the means above, then you can check to see if the file D3DX9_30.DLL has been installed on the machine. Other versions of the DLL have different filenames.





Re: Game Technologies: General How to detect version of D3DX installed?

Scythen

So, apparently there is no way to determine the version using DxDiag

What about file version of d3d9.dll I was thinking of checking that.

I guess there is no harm in just looking for the D3DX9_30.dll but it just seems like the DxDiag should support this.





Re: Game Technologies: General How to detect version of D3DX installed?

Ross Ridge

There's no way I know of to determine what versions of the D3DX library have been installed using DxDiag. Essentially, the D3DX DLLs aren't considered part of DirectX runtime, they're an "add-on" provided by the DirectX SDK. Checking the version number of D3D9.DLL will only tell you what version of DirectX is installed.





Re: Game Technologies: General How to detect version of D3DX installed?

Scythen

Is there a particular web page I should direct users to

maybe http://www.microsoft.com/windows/directx





Re: Game Technologies: General How to detect version of D3DX installed?

Ross Ridge

If you go to the Microsoft WWW page where you can find the current SDK to download, you'll find a link for the "DirectX End-User Runtime Web Installer". This is the link is where you want to direct users to.



Re: Game Technologies: General How to detect version of D3DX installed?

Wazoo

Scythen wrote:

With the newer versions of DirectX there are several different D3DX dlls that exist. Just checking for DirectX version 9.0c is not sufficent as that version contains several revisions of the D3DX dlls. If a game ships with the April release the earlier versions of DirectX 9.0c will not work.

How can the exact installed version be determined



It's a bit of work (and probably not ideal) but I've taken to "hardcoding" the D3DX dll version that I'm shipping with, and adding a rudimentary call in my code to look for that particular DLL...

Kinda icky, but it allows me to try to present the player with a "friendly" message about incompatible DLL's, instead of popping up a generic "Bam! DLL not found Sucka!" dialog.

Like I say, probably not ideal but it works for me so far. *kocks on wood*





Re: Game Technologies: General How to detect version of D3DX installed?

djperegrine

Accually I have heard its illegal or something to distrubute the dll with your program. The way I do it is I have a "launcher" app that will launch and execute code via a plugin system. In a very basic sense I do :

Assembly assem=Assembly.LoadFile("mydll.dll");
Iplugin myplugin=(Iplugin)assem.CreateInstance("myclass");
myplugin.Init();

Iplugin should look something like:
public interface Iplugin
{
void Init();
}
and the dll should contian something like

class myclass:Iplugin
{
public void Init(){
//Do something!
}
}
Instead of giving a generic error message if a dll is missing, it will throw a exepection which you can catch and say whatever you need. Also now you have a plugin system for your app!





Re: Game Technologies: General How to detect version of D3DX installed?

Tim Burris

Ok, so the core runtime hasn't changed, so its version doesn't change. Sure, that makes sense. But Direct3D, which these days is the main reason developers USE DirectX, IS changing versions with nearly every bi-monthly update. I've found no way to update the D3D 'add-on' without installing the DirectX runtime. In this sense, D3D IS part of the DirectX runtime package. And since its version is changing, the runtime package's version should change. This is common sense. WTF.

I've also found no reasonable way to check for the version number of D3D. It's not in HKLM\software\microsoft\direct3d, where one might expect. I want our http updater to intelligently decide whether the user needs to download and install a DX update to run our game. Currently I have to explicitly search for the d3dx9_30.dll that appeared in the release we decided to build against. I'm not willing to make them download the entire DirectX runtime package on top of our game binaries 'just in case'.

DirectX runtime updating is BROKEN and unacceptable. Please, MS, if you're not going to fix it, at least give us a way to work around it.




Re: Game Technologies: General How to detect version of D3DX installed?

waruwaru

These links may be of interest to you

http://msdn2.microsoft.com/en-us/library/bb174600.aspx
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=369133&SiteID=1
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=211093&SiteID=1
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1215890&SiteID=1

One of the links suggested checking the install directory name for the date variant. I don't know if that is a localized string or not though...






Re: Game Technologies: General How to detect version of D3DX installed?

The ZMan

The correct solution is to simply include the correct D3DX cab file from the redsitributable and call it from your setup program. You do not have to check anything as DXSetup will do that for you. This is very well documented in the help files.

'illegal' is a strong word but the SDK EULA does say you cannot include the DLLs with your application. For one thing MS can't find them to patch them if there ever is a security issue and for another you litter the ahrd drive with duplicate files.






Re: Game Technologies: General How to detect version of D3DX installed?

Tim Burris

The ZMan wrote:
The correct solution is to simply include the correct D3DX cab file from the redsitributable and call it from your setup program. You do not have to check anything as DXSetup will do that for you. This is very well documented in the help files.


That solution is all well and good for programs that ship on a disc and never change the version of DirectX they use. In fact we already do this.

That solution is no good for programs that ship on the web or switch to a new version of DirectX e.g. during the lifetime of a massively multiplayer game.




Re: Game Technologies: General How to detect version of D3DX installed?

The ZMan

I never said Microsoft had a good solution for web delivered games - they don't IMO - I just wanted to let people know the only correctly documented way to do it. directx@microsoft.com if you want to try to change their minds and its on my list of things for the MVP summit next month.

If all you care about is checking d3dx versions then DX setup is smart enough to install whatever CAB files you give it. Assuming you know which one you want all you have to include with your setup or patching application is the correct d3dx cab file (The Feb 06 ones are 1.3Mb and 1.0Mb for 64 and 32 bit respectively. Plus dxsetup.exe, dsetup.dll and dsetup32.dll, dxsetup.cab and dxdllreg_x86.cab which gives you a little over 2Mb... So for 4Mb you can have both 64 and 32 bit coverage of your particular version. Yes I know its not perfect but its all we have right now. (see http://msdn2.microsoft.com/en-us/library/bb174600.aspx for which files are needed etc).

One of the MVPs has a white paper on doing the kind of installer you want http://www.xmission.com/~legalize/d3d/installer.html - I think he checks for the d3dx dlls by doing a simple LoadLibrary call.