Sign in to follow this  

Including DirectX Runtimes in an installer

This topic is 2461 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Our application uses D3D 9.0c including HLSL shaders. We've been shipping [b]dxwebsetup.exe[/b] with it, a 250Kb app which I though handled downloading the latest DX runtimes. But I notice as it runs it downloads a load of stuff like "SDK updates" and "Managed DX". Also on the [url="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&displaylang=en"]download page[/url] it says: [quote][font="Tahoma, Arial, sans-serif"][size="2"][list][*]The DirectX end-user installation includes the D3DX, HLSL Compiler, XInput, XAudio, and Managed DirectX 1.1 components.[*][b]Note that the DirectX Runtime (Direct3D, DirectInput, DirectSound) is not part of this package[/b] as it is included as part of the Windows operating system, and therefore cannot be installed or uninstalled. Updating the DirectX Runtime is achieved by installing the latest Service Pack or obtaining a newer version of Windows.[/quote][/list]Now I'm feeling confused. I do not need people to have the very latest DX (since we only use 9.0c not 10 or 11) but this installer downloads quite a lot of stuff. I have a 30Mb DX 9.0c installer somewhere which I imagine corresponds to the 95Mb version today but I seem to recall you're not supposed to ship that? I've looked at this a few times in the past and always end up somewhat confused, for a start shouldn't XPSP2/3 and Vista/Windwos7 have DX9.0c installed by default anyway? Yet when I ran our app on a clean Vista machine (with all Windows updates) it was unable to initialize D3D. Is that because I have inadvertently got a newer DX on my build machine which is forcing other machines to need the same?


[/size][/font]

Share this post


Link to post
Share on other sites
I have started a topic regarding legal issues with distributing DirectX some time ago, so I will not repeat what I have found out, but will just give link to it:
http://www.gamedev.net/topic/585881-directx-setup-and-shareware-problem/page__p__585881#entry585881

Regarding why your applications are not being started correctly:
Please note, that DirectX 9.0c is a version of core DirectX libraries. It is always the same and is included in Windows XP SP2, as well as on newer systems by default. But apart from that there are additional extension libraries (like D3DX etc.) that can vary between DirectX from different dates. What you need is to find out which libraries are being used by your application (you can use Dependency Walker for such things). Next you can create your own small version of the installer by including few files required by it by default and next adding there only libraries of DirectX that your app is using. Generally you take DirectX redist from your DirectX SDK and remove from it all files that are not necessary. This way I was able to reduce size of DirectX installer in my app to around 3 MB (you can assume, that core DirectX 9.0c is already installed - that's what I did).

There is an article about preparing small version of DirectX setup somewhere on MSDN (describing different options of redistributing it), but I do not remember the URL at the moment.

Hope this will help you.

Share this post


Link to post
Share on other sites
So, if my 3D engine has a dependency on D3DX then the chances are it will automatically be dependent on whichever D3DX version is on my build-PC, basically? I'm pretty sure this is the only extra thing used but you're not allowed to ship D3DX DLLs manually IIRC, you have to use an official MS installer - legally that is, I know people [i]do[/i] it but for a commercial project I want to stay within the rules.

Good reminder on checking the dependencies. I have a 3rd-party tool, but is there one supplied with VS/Windows too?

Share this post


Link to post
Share on other sites
[quote name='JDX_John' timestamp='1298362510' post='4777441']
So, if my 3D engine has a dependency on D3DX then the chances are it will automatically be dependent on whichever D3DX version is on my build-PC, basically? I'm pretty sure this is the only extra thing used but you're not allowed to ship D3DX DLLs manually IIRC, you have to use an official MS installer - legally that is, I know people [i]do[/i] it but for a commercial project I want to stay within the rules.

Good reminder on checking the dependencies. I have a 3rd-party tool, but is there one supplied with VS/Windows too?
[/quote]

You're not allowed to distribute it manually, but you are allowed to lighten the DirectX SDK Redist installer. If you read the EULA / redist notes you will notice that you may redistribute it and list of files that has to be included - that means that rest can be removed. This approach is mentioned on MSDN:
http://msdn.microsoft.com/en-us/library/ee416805%28v=vs.85%29.aspx
Please read Small Installation Packages section.

Regarding files you will be dependednt, probably it will be the newest version of D3DX for specific D3D version and architecture (32 / 64 bit) - I'm sure that if your application is 32-bit you need no 64-bit version of D3DX, but not sure if your app is 64-bit.

As far as I know Dependency Walker is included in Visual Studio 2005 (but not added to Menu Start). I was not able to find it in VS 2010. Maybe it was renamed (previously the executable was called depends.exe)

Share this post


Link to post
Share on other sites
[quote name='JDX_John' timestamp='1298362510' post='4777441']
So, if my 3D engine has a dependency on D3DX then the chances are it will automatically be dependent on whichever D3DX version is on my build-PC, basically?
[/quote]

Your app will be dependent on whichever version of D3DX that your application links to. If you have the June 2010 DX SDK installed and you link to the d3dx9.lib from that SDK, then your app will depend on the June 2010 version of D3DX.

Share this post


Link to post
Share on other sites
Do they actually keep adding functionality to the D3DX9 libraries then?

I'd never realised you could customise the installer files in the way mentioned, thanks for the clarification.

Share this post


Link to post
Share on other sites
[quote name='JDX_John' timestamp='1298451461' post='4777881']
Do they actually keep adding functionality to the D3DX9 libraries then?
I'd never realised you could customise the installer files in the way mentioned, thanks for the clarification.
[/quote]

I'm not sure about adding functionality, but there are always some bugs to be fixed etc. so I suppose that's the difference.
It's good to see that my reply was helpfull ;) You're welcome

Share this post


Link to post
Share on other sites
A little update. We've found we can strip out a load of files from the redist folder, but I'd like to then package these into a single installer .EXE file like MS provide if you download their redist installer. Is there a simple way to do this? Is it a Windows generic thing, or something DX-specific?

Share this post


Link to post
Share on other sites

This topic is 2461 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this