Microsoft Game Technologies: XNA Requirements Checker

  • dczraptor / 100 / Mon, 01 Feb 2010 05:21: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/244547/«« 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 12:52: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 12:53: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 12:54:00 GMT |

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

      waruwaru | Wed, 05 Sep 2007 12:55: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 12:56: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 12:57: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 12:58: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 12:59: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:00: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:01: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:02: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:03: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:04: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:05:00 GMT |

  • Microsoft Game Technologies Questions

    • XNA Game Studio Express. released!!!!

      There is a post about the XNA Game Studio Express was cancelled.... but the true is that it was rele...

      By roygar

    • XNA launcher + active download

      I noticed that while I was downloading the Lost Planet demo last night, I wasn't able to launch the ...

      By waruwaru

    • xna creators club online

      when i sign in i have been presented with a fill out formand a botton that saysjoin now!but the bott...

      By michaelhansen

    • Here we go!!

      http://www.microsoft.com/downloads/details.aspx?familyid=21e979e3-b8ae-4ea6-8e65-393ea7684d6c&di...

      By gms0012

    • XNA Overview Webcast

      Register ...

      By jimperry

    • XNA Parallax Engine

      Hi,I hope this doesn't break any of the rules, I have checked and I don't think that it does.The par...

      By kinlan

    • XNA is really great

      Hello! My first post on the forum. My name is Phantasy, I like fantasy so that is why. I am sure XNA...

      By phantasy

    • XNA Article

      There's a nice article over at the Game Career Guide site, with comments from some of the XNA team a...

      By jimperry, 1 Comments

    • My game's 2D engine is complete ;)

      Hey all, just wanted to brag a bit about my game's engine being complete. Because my game has low re...

      By bryanedds, 3 Comments

    • XNA Framework and XNA Game Studio Express download...

      hi zman.. can i use it with vs 2005? the setup says that i need the express edition? but i do have v...

      By gms0012, 5 Comments

    • XNA GSE and Vista

      So here's a quick question. I'm pretty sure it's been asked before but none of the combinations I ca...

      By ivolved_mike_brown, 9 Comments

    • XNA framework for non C#

      One of the great advantages of the .NET framework is that developers can work on the same project in...

      By tablo, 14 Comments

    • xna launcher problems after update

      After the most recent Xbox 360 dashboard update, the XNA Launcher cannot find my subscription upon s...

      By krisselden, 1 Comments

    • XNA on XBox360 available when?

      So when is the runtime on the 360 going to be released (in beta/alpha/whatever) so we can play with ...

      By andyl, 3 Comments

    • xna racer, how and when can i get it

      i saw this thing on something called xna racer, and it amazed me that we could do this with xnahttp:...

      By gu1tarfreak, 11 Comments