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 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.
- 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
- 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.
- Go to the temporary folder and run redists.msi
- Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v4.0\Setup\XLiveRedist.msi
- Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v4.0\Redist\XNA FX Redist\xnafx40_redist.msi
- Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v4.0\Setup\xnaliveproxy.msi
- Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v4.0\Setup\xnags_platform_tools.msi
- Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v4.0\Setup\xnags_shared.msi
- 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
- Go to the temporary folder you extracted to in step 2 and run the MSI named arpentry.msi
- Open a cmd window and run “C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe” /setup
- 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.
- 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 😥