Packaging a DirectX Game

Hi,

I've recently started programming using DirectX and C#. I created a game and it runs fine on my development machine (.Net 1.1,  DX SDK). But when I compile the game for a release, and move it onto a machine that only has the DirectX runtimes, it fails to find any of the neccessary libraries and will not start. I've tried telling to to "include resources" when it compiles, in which case it copies a bunch of .dll's to the release directory, but that still wont work on regular machines. It works fine on any machine that has the SDK installed.

The regular machines are all running Dx9.0c and .Net 1.1. Any idea how to package a release of a peice of DX software so that it runs on machines that don't have the SDK installed


Answer this question

Packaging a DirectX Game

  • wyatt blake

    I've not actually done it but I beleive there is enough information in the C++ docs to do this. http://msdn.microsoft.com/library/default.asp url=/library/en-us/directx9_c/directx/directsdk/ProgrammingGuide/InstallingWithDirectSetup.asp

    From my reading you install the SDK and make sure to add in the optional redist files option. Then you choose what you want in your redist based on if you know for sure that your end users will already have the core files etc. Then add all the files to your installer and make the call into DXSetup from your installer.

  • Steven A. Dunn

    To clarify Microsoft.DirectX.Direct3DX has changed with each release (becuase the underlying D3DX.dll changes). The rest of the assemblies have not changed since April 05.

    You also need more than just the managed assemblies, you need the underlying native code DLLs since managed directX just calls them.

    However, the EULA for directX does not allow you to pick and choose individual files. You need to get the redistributable files (they are an optional component when you install the SDK) FOR THE SAME VERSION YOU CREATED YOUR APP WITH! and call the redist from your applications installer. Since this is a .Net app you need to ensure that .net 1.1 is on the machine BEFORE you call the DX redist otherwise it will not install the managed libraries.

    Is there a sample/tutorial/step byt step on how to do this - not that I have seen anywhere. Maybe you can write it up as you do it. It is a common question.

  • Norm Estabrook - MSFT

    Have you tried installing the Managed DX installation by itself and see if this solves the problem

  • Dan Rasmussen

    Yeh this needs to be documented somewhere, because it's a mess--especially since it's near impossible to test whether your installer actually works.  We were dumb enough not to image our machines before starting to test the installer, and somewhere along the way all the required stuff got installed.  So we assumed we'd found the magic incantation and released our app for testing.  But our testers can't run it because they're missing the D3DX stuff.


  • wgpubs

    And as for testing, Virtual PC or VMware are great for this kind of testing. YOu can't run yor game very far due to the lack of hardware acceleration but its a good way to test of if the game will at least start up or if there are any DLLs missing. You can also try lots of scenarios such as missing .Net framework, old version of DX etc.

  • Guy Smith-Ferrier

    With managed directX you will need to make sure that the clients are running the run time that matches the sdk that the application was developed in. For example if you compiled an application with the Oct 2005 release you would need to Oct 2005 run time installed. This is because the Assemblies for the DirectX system have changed on most of the updates.

  • Dave Speck

    Note that while several people have done similar things to Jeremy, you are technically breaking the DirectX EULA by doing it this way.

    i.        Right to Use and Distribute.  The code and text files listed below are “Distributable Code.”< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

    ·         DIRECTX REDIST.TXT Files.  You may copy and distribute the object code form of code listed in DIRECTX REDIST.TXT files.


    The files listed in redist.txt do not include these individual files, you need to distribute the original CAB files and call dxsetup.

    See
    http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=91555&SiteID=1
    http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=83603&SiteID=1
    http://groups.google.com/group/microsoft.public.win32.programmer.directx.misc/browse_thread/thread/71d877e1df5b82a8/aec3e729ea95428d
    http://groups.google.com/group/microsoft.public.win32.programmer.directx.managed/browse_thread/thread/bc681ac066c125d0/59761b1d747bd921




  • Rafiq

    Tell your customer to install 1) .NET, and 2) DirectX 9.0c (possibly from windows update).  Then you need to distribute the following files (if you are using the October SDK release):

    d3xd9_27.dll
    Microsoft.DirectX.Direct3d.dll
    Microsoft.DirectX.Direct3dx.dll
    Microsoft.DirectX.dll
    (any other managed directx dll's you are using, for instance directsound, etc.)

    You can download the example off my website, gosub.com, and see how I've done it.

    -Jeremy


  • Packaging a DirectX Game