Microsoft Game Technologies: XNA Requirements Checker

  • dczraptor / 100 / Sat, 30 Jan 2010 21:53:00 GMT / Comments (14)
  • Well, I finally decided to write a little utility that checks for the required components of XNA (excluding .Net2.0 because i wrote it using .net 2.0) because I've seen just too many threads about the game not working on non-dev pcs. This program lets the user know if they have an outdated graphics card, installs the latest directx using directx webinstall, and installs the xna framework redist 1.0. I bundled it together inside a NSIS installer package because it was the easiest method i knew of. Not the most elegant way, i know. If anyone has a better solution, please let me know.

    I included the license for both directx and xna, and if i missed any legal issues with redistributing the packages in my own way, please let me know. I hope someone finds this useful.

    page: http://xnamatrix.com/xnareq.php

    direct link: http://xnamatrix.com/download/XNAReq.exe

    edit: i changed the direct link so I could link it with my download counter

    edit2: updated the package to include the basic DirectX dlls so it can check graphics cards. I mistakenly assumed everyone would have at least 9.0 - bad thing to do.

    edit3: updated the package to clean up the trash it leaves behind

  • Keywords:

    xna, requirements, checker, microsoft, game

  • http://msdn.itags.org/microsoft-game/244665/«« Last Thread - Next Thread »»
    1. Very cool. Next time someone complains their XNA games don't work, we will just point them to your utility. Thanks!

      As a side suggestion to XGSE team, maybe they should put a try/catch block in starter kits/projects to make troubleshooting a lil easier.

      waruwaru | Wed, 05 Sep 2007 13:07:00 GMT |

    2. Thank you very much. I think it is an excellent program and player just click once to check and then play.
      I think it will be much better to use MFC ( or earlier version of .NET) to write this application. Still there are numerous computers using old version of .NET, or even do not have it.

      summoner | Wed, 05 Sep 2007 13:07:00 GMT |

    3. Yes it would, except I don't know MFC, and including .NET would increase the size of the download from 1.76 mb to about 25 mb. Not the best solution.

      dczraptor | Wed, 05 Sep 2007 13:08:00 GMT |

    4. if you write it as a console app, then you don't need any MFC... ;)

      waruwaru | Wed, 05 Sep 2007 13:10:00 GMT |

    5. Good idea, i might look into that if i have time, but the problem of having a 23 mb .NET redist included isn't very pleasing. I guess I could redirect the user there, but that kinda defeats the purpose of bundling it together in the first place.

      By the way, currently, I'm using NSIS to copy the redist packages and my app over to a temp dir and then executing them from within my app. Is there an easier way to do this? I basically want it to be in one file, and when you double click it, it merely runs my one little window without any other extraneous screens.

      dczraptor | Wed, 05 Sep 2007 13:10:00 GMT |

    6. If you want to get fancy, have the util download the .net redist when it's needed.... ;)

      waruwaru | Wed, 05 Sep 2007 13:12:00 GMT |

    7. Is there an easy way to check whether a certain thing is installed? All i'm doing is executing the redist even if you already have it, and then letting the redist exe decide what to do. Simple and keeps my code short, but there's gotta be an easier way.

      dczraptor | Wed, 05 Sep 2007 13:13:00 GMT |

    8. They probably all have registry key/hives that you can check. That, or use windows api to check the dll/exe version resources directly.

      NSIS has some function to do the DX

      http://nsis.sourceforge.net/Detect_DirectX_Version

      Heh, just found this little interesting article

      http://www.codinghorror.com/blog/archives/000663.html

      waruwaru | Wed, 05 Sep 2007 13:14:00 GMT |

    9. Unfortunately, the NSIS link you provided only checks from the registry. That may sound ok, but if you actually look into the registry, the version number is exactly the same for all versions of 9.0c. I went with checking the actual .dll file in system32. Specifically, d3d9d.dll. To account for installation on other partitions, i checked to see which partition you ran my program off of and then appended that to the rest of the string. XNA can be checked through the the registry, but just to be consistent, I also checked through PF\Common Files\Microsoft Shared\XNA\Framework\v1.0\XnaNative1.dll. Then, i just compared the version numbers on the actual assemblies, which are accurate as far as I can tell. As I'm new to this .net with registry/checking for system files thing, let me know if there's an easier way. I updated my app, and it runs much faster for systems with xna or directx already installed.

      edit: i just discovered that d3d9d.dll is a debug file -_- how embarrasing. I was checking to see which files were updated by feb 2007 so i could tell which one i should check against, but apprarently, i picked the wrong file. i switched to d3dref9.dll, which seems to have changed between dec and feb updates. But there really must be an easier way to do this without running the webinstall itself.

      dczraptor | Wed, 05 Sep 2007 13:15:00 GMT |

    10. Follow this link:

      http://msdn2.microsoft.com/en-us/library/bb174600.aspx

      I browsed through a little of it, it's not clear if there is a way to check for the Feb or Dec build. Maybe DirectX forum folks can shed more lights on the version chaos.

      EDIT: Couple more links

      http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=369133&SiteID=1
      http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=211093&SiteID=1

      Typically, you can find progrms' installation path in the registry, and then you can look for the DLLs you want in that path.

      EDIT: Just read the first post again. I would stay far away from including dlls in your tool. You might want to try to load the dlls you want and get the function pointers dynamically. If that fails, you know the target system doesn't have the version/dll that you want.

      waruwaru | Wed, 05 Sep 2007 13:16:00 GMT |

    11. The DirectSetup Api can help with this. Check out this article for more information.

      Cheers,
      Leaf.

      leaf | Wed, 05 Sep 2007 13:17:00 GMT |

    12. Thanks for the links, but unfortunately, none of them gave any great insights.

      The DirectSetup Api only works if you have all of the redist files on the local machine. The methods that it describes to test to see if components are missing doesn't provide the functionality i need. this only checks for major revision numbers and this merely checks the core components, which hasn't changed since the first 9.0c came out. The only method that has any hope is this: http://msdn2.microsoft.com/en-us/library/bb172717.aspx, but it basically checks the individual files anyway.

      I ran the dxwebinstaller on a new machine with only basic 9.0c, and came up with the list of files it updates:

      d3dx9_24.dll - d3dx9_32.dll (_32 was updated from the december release)

      x3daudio1_0.dll - 1_1.dll (last updated from the feb release)

      xactengine2_0.dll - 2_6.dll (last updated from feb release)

      xinput1_1 - 1_3 (last updated in the october release)

      I guess the most thorough method would be just to check to see whether all of those files are there. The most efficient would merely check for x3daudio1_1.dll and xinput1_3.dll. Although I think the file that was causing the most problems for everyone was d3dx9_32.dll because that's the one that manages the graphics device, so I'll probably check for that one as well.

      dczraptor | Wed, 05 Sep 2007 13:18:00 GMT |

    13. That's a nifty tool for checking. I'd like to report a bug with it, however.

      It seems to report that I have no graphics hardware when I'm quite certain my X1900XT qualifies. This is the same machine I use for game development.

      tbird761 | Wed, 05 Sep 2007 13:19:00 GMT |

    14. Here's what I do to check the graphics card:

      Caps caps = Manager.GetDeviceCaps(Manager.Adapters.Default.Adapter, DeviceType.Hardware);

      If it throws an exception, then I print out that it didn't detect a graphics card. I've uploaded a new version, however, and I have two error messages now. The first one is "no graphics card detected", which means that the above line has thrown an exception. The second message is "error encountered while checking graphics card", which means that it was able to execute the above line and find a graphics card, but was not able to check it's capabilities. Please let me know which one you receive.

      One thing of note: i have not tested on vista, and I have not tested it on any ATI card. I've only tested with a computer with no graphics card, a geforce go5600, 5900, and 6600 GT. Each case has worked like i expected, so I'm not sure what the problem you're encountering is.

      If anyone can confirm that it works on vista/ATI cards, I'd be very appreciative.

      dczraptor | Wed, 05 Sep 2007 13:20:00 GMT |

  • Microsoft Game Technologies Questions

    • XNA Pro

      ok here from the official faq:Q: How widely used is C# in the gaming industry? A: The vast majority ...

      By darko01, 2 Comments

    • XNA Framework in Vista

      Will XNA Framework ships with Windows Vista ?...

      By odv, 1 Comments

    • XNA on Windows XP ?

      Hi people. This is my first post in MS forums, so please, don't make me alone in this thread :) I fo...

      By prasa, 3 Comments

    • About Updatesurface

      In my program I need update texture Frequently, So I use a off-screen-plain-surface(created in D3DPO...

      By hourousha, 1 Comments

    • XNA Audio Tutorial 2: Music

      I have added a new tutorial for adding music to your game:XNA Audio Tutorial 2: Music...

      By markcoffman, 2 Comments

    • XNA Framework and the Number of Runtimes

      Hi, I am interested in migrating some projects to the XNA Framework in the near future. I'm curious ...

      By philvaira, 1 Comments

    • XNA run time - System.IO.FileNotFoundException was...

      I have no problem building using XNA and C# 2005. When I try to "start new instance" I see...

      By aiguy, 3 Comments

    • XNA libraries

      I created an animation component, and it works fine on my computer, and on my friends computer, but ...

      By leclerc9, 6 Comments