Part of my job over summer is to help to prepare software to be deployed into the teaching labs. Mostly this involves harassing staff to find out what software packages they need, but occasionally the problems get a little more interesting. This year that was the case with XNA.

xna_logo

XNA is a great framework for creating games, and we use it as a tool to motivate students to learn how to program whilst creating great games at extra-curricular events such as the three thing game. For us, a tools like XNA is an invaluable intrinsic motivator – inspiring students to want to learn to code, as opposed to being motivated because we said so, or because they will get better grades.

According to the official documentation XNA requires Visual Studio 2010. Now, clearly it’s possible to install both Visual Studio 2010 and Visual Studio 2012 on the same machine, but that would have a big impact on the size of the image. We’d rather not install both if we don’t have to, but if you try to install XNA on a machine that doesn’t include Visual Studio 2010 the installation will fail.

We’re also keen to provide students with as seamless an experience as possible when moving from working at home to working in university – although in the university labs we do insist that students wear pants at all times. It’s with this in mind that I’m writing this blog post, so that students can use XNA at home with Visual Studio 2012 to allow them an easy transition to and from the machines at the University.

After some digging around as well as a decent amount of experimentation we found a solution. Although I’m not 100% clear on how it works my interpretation. Normally when you install XNA there are a bunch of steps to go through. One of the steps copies some files to the Visual Studio directory, which it assumes is Visual Studio 2010. When that step fails the installer rolls back all the other changes like any good installer should. This process extracts each individual step, and when the time comes requires you to manually copy the files to the correct directory.

You’ll need to download this zip file which contains the entire XNA setup and the folders that you’ll need to copy yourself.

  1. Download the zip file and unzip it somewhere. You should see an executable called XNAGS40_setup.exe and a folder called XNA Game Studio 4.0
  2. Open a command line and navigate to the folder that contains XNAGS40_setup.exe – then run XNAGS40_setup.exe /x . You’ll be asked to enter a folder. It’s probably easiest if you create a new empty folder. This folder is temporary and can be deleted after you are done.
  3. Go to the temporary folder and run redists.msi
  4. Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v4.0\Setup\XLiveRedist.msi
  5. Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v4.0\Redist\XNA FX Redist\xnafx40_redist.msi
  6. Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v4.0\Setup\xnaliveproxy.msi
  7. Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v4.0\Setup\xnags_platform_tools.msi
  8. Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v4.0\Setup\xnags_shared.msi
  9. Copy folder XNA Game Studio 4.0 provided in the zip file you downloaded at the start to C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft
  10. Go to the temporary folder you extracted to in step 2 and run the MSI named arpentry.msi
  11. Open a cmd window and run “C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe” /setup
  12. Delete the temporary folder you created, as well as the zip file and the folder you extracted that to. You don’t need those any more.
  13. Create some awesome games using XNA! 😀

That should have done the trick. Let me know if it works for you :D, or even if it doesn’t 😥

Advertisements