Tuesday, May 29, 2018

57.) How to Install & Run XNA on Windows 10


       Contrary to the popular belief that XNA is no longer supported on newer versions of windows (no newer than Windows 7) due to its discontinuation by Microsoft, it is possible to get XNA running on Windows 8, as well as Windows 10. In its pure form, XNA will not work as a new Windows 10 application, however there is a platform called Project Centennial which helps to bring win32 (XNA) games to Windows 10. Luckily there is an open source implementation of XNA which is essentially the exact same thing and that is currently supported on all windows versions. It’ called MonoGame and I thoroughly enjoy it. 


Pre-Requisites  

1.) You will need Visual Studio C# 2008 Express to run XNA 3.1. You can download it here 

2.) When the installation process completes, click on Exit. 

Import Note: You will need to register Microsoft Visual C# 2008 Express within 30 days by clicking on Help > Register Production. Once you provide all of the required registration information, you will be presented with a 14-character registration key. Copy and paste this key into the Registration Window and click on the Complete Registration button.

I noticed when I entered in my serial key for Microsoft Visual Studio 2008 C # Express, it didn’t work for some apparent reason. Luckily there is a solution; a way around this problem if you encounter it.

1.) First, Press your Windows Key and R together to open the Run window.
2.) Now type in “regedit” without quotes, hit enter, and navigate to: Computer\HKEY_CURRENT_USER\Software\Microsoft\VCSExpress\9.0\Registration

If typed correctly, a window named ‘Registry Editor’ should appear in just a second.



3.) Delete the value Params. 

4.) Right click on the key ‘Registration’ in the tree, and click permission. 

5.) Click Advanced… 

6.) Go to the permissions tab, and uncheck the box labeled ‘Inherit from parent the permission entries that apply to child object. Include these with entries explicitly defined here.’

7.) In the dialog that opens. Click copy


8.) Hit OK in the ‘Advanced’ window 

9.) Back in the first permission window, click your user, and uncheck Full Control. 

10.) Do the same thing for the Administrators group. 

11.) Hit OK or Apply. Congratulation, you will never again be plagued by the registration nag, and just like WinRAR, your trial will never expire. 

Important Note: I recommend restarting your computer just in case. 

If you are having trouble, check out this video below which has a similar process to the step above. The only difference is that it is less steps and has you delete the entire ‘Registration’ folder and tells you to close the Registry Editor. 





XNA 3.1 
       Now you are ready to Install XNA 3.1.

1.) Click here to download the XNA 3.1 installer. This will take you to the page where you can click on the Download option. 

2.) A file named XNAG31_setup.exe will be downloaded.

The setup wizard will guide you through the installation process.

4.) Double-click on the XNA installation program. Click on Continue if prompted for permission to continue.


5.) The Welcome to XNA Game Studio 3.1 Setup Wizard window appears. Click on Next.

6.) The Microsoft Software License Terms are displayed. Read them and then select I accept the terms in the License Agreement option and click on Next.

7.) You will be prompted to allow Game Studio and XNA games to communicate through the firewall on your computer. Click on Yes, I Wish to Select These Rules to Enable, and then enable both of the following options and click on Install.

Allow communications between an Xbox 360 and your computer on the local subnet.
Allow the communication of network games built on the XNA Framework.


8.) XNA Game Studio 3.1 will copy files to your computer and complete the installation process. Once the process is complete, a message is displayed announcing that Microsoft XNA Game Studio 3.1 was installed into Microsoft Visual C# 2008 Express. The Take Me to the XNA Creators Club Online Website option is displayed and enabled.

9.) Click on Finish. Congratulations! You now have XNA 3.1 running on Windows 10.

There are some very nice Templates that come
with XNA 3.1


Why in the world would you want to run XNA 3.1 on Windows 10? 
       I have been asked this question many times. I got my start in game development with XNA like many others. That being said, the vast majority of my game projects were created in XNA version 3.1. Prior to installing and successfully running XNA 3.1 on Windows 10, it was a hassle going back and forth between two different computers since XNA 3.1 ran on versions no later than Windows 7. Now I can keep all my projects in one place and not have to worry about whether or not they will run for the most part. There were many breaking changes between XNA 3.1 and 4.0. Now that I have figured out how to run XNA 3.1 on Windows 10, I can revive my old game projects from the dead.


       Once revived, I can convert them to XNA 4.0 also with the help of the XNA 3.1 to 4.0 Cheat Sheet. Once I get my projects running in XNA 4.0, I can then port them over to MonoGame. So I am using MonoGame to essentially port my game projects to other platforms besides the default platforms supported by XNA: Windows PC, Window Phone 7, Xbox 360 and Zune. It is also possible to create a wrapper in Unity and get your XNA game projects running in the Unity Game Engine; however it will require some work. Below is a screenshot of Dungeon Quest from the book Professional XNA Game Programming 2.0 that I converted to XNA 3.1 and successfully got running on my Windows 10 computer. I plan on converting it as well with so many other XNA 3.1 game projects to XNA 4.0 and MonoGame.

Dungeon Quest Pic 1

Dungeon Quest Pic 2


XNA 4.0 & Refresh Version
       Microsoft XNA Game Studio only supports Visual Studio 2010. Later versions of Visual Studio are only partially supported (only Windows Phone 7 projects). Here is a list of workarounds to use the Microsoft XNA Game Studio with Visual Studio 2012 and higher.

How to Setup XNA 4.0 for Windows 10 
1.) Install the Games for Windows Live Client (Mainly for Windows 8 and higher users)

2.) Install Visual Studio 2012 or higher.

3.) Install Windows Phone SDK 7.1

4.) Install Windows Phone SDK 7.1.1 Update

(Note: The Windows Phone SDK contains XNA Game Studio)

5.) Copy the folder named XNA Game Studio 4.0 from

C:\Program Files (x86)\Microsoft Visual Studio 10.0\common7\ide\extensions\Microsoft

to

  • (for VS2012) C:\Program Files (x86)\Microsoft Visual Studio 11.0\common7\ide\extensions\Microsoft
  • (for VS2013) C:\Program Files (x86)\Microsoft Visual Studio 12.0\common7\ide\extensions\Microsoft
  • (for VS2015) C:\Program Files (x86)\Microsoft Visual Studio 14.0\common7\ide\extensions\Microsoft
  • (for VS2017) C:\Program Files (x86)\Microsoft Visual Studio 16.0\common7\ide\extensions\Microsoft

On some systems Visual Studio is incorrectly installed in the Program Files (x86) folder instead of the Microsoft Visual Studio 12.0 folder. In this case you have to use this target path:

 C:\Program Files (x86)\Common7\IDE\Extensions\Microsoft

6.) Start a text editor with administrator privileges. Open the file extension.vsixmanifest from the folder XNA Game Studio 4.0. and change the supported Visual Studio version from

<VisualStudio Version="10.0">

to

  • (for VS2012) <VisualStudio Version="11.0">
  • (for VS2013) <VisualStudio Version="12.0">
  • (for VS2015) <VisualStudio Version="14.0">
  • (for VS2017) <VisualStudio Version="16.0">


This works for Visual Studio Professional. If you use an edition that is not listed, you might have to add a tag for this edition. For example, for Visual Studio 2013 Premium or Ultimate change

<SupportedProducts>
  <VisualStudio Version="10.0">
    <Edition>VSTS</Edition>
    <Edition>VSTD</Edition>
    <Edition>Pro</Edition>
    <Edition>VCSExpress</Edition>
    <Edition>VPDExpress</Edition>
  </VisualStudio>
</SupportedProducts>

to
<SupportedProducts>
  <VisualStudio Version="12.0">
    <Edition>Ultimate</Edition>
    <Edition>Premium</Edition>
    <Edition>Pro</Edition>
 </VisualStudio>
</SupportedProducts>


7.) On some PCs the following step is necessary: Clear the VS extension cache. For example, for Visual Studio 2013 delete the files in
%localappdata%\Microsoft\VisualStudio\12.0\Extensions

8.) Open the command prompt with administrator privileges. Change the working directory to the directory which contains devenv.exe:

(for VS2012) C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\
(for VS2013) C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\
(for VS2015) C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\
(for VS2017) C:\Program Files (x86)\Microsoft Visual Studio 16.0\Common7\IDE\

or

C:\Program Files (x86)\Common7\IDE\

and execute 

devenv.exe /setup

to rebuild the extension cache. 


Known Issues: Content is always rebuilt
       In some solutions XNA content projects are always rebuilt even if the output is up-to-date - which can be annoying because building content can take many minutes in larger projects. Usually, this happens if a content pipeline project is included in the solution. The content pipeline assembly is updated every time the project is built, which causes the content to be rebuilt. A simple workaround is to build the content pipeline projects once and then unload it from the Visual Studio solution: In Visual Studio open the Solution Explorer, right-click the content pipeline project and select Unload Project in the context menu.

       If this does not solve the problem and the content is still rebuilding, then you can check the Visual Studio build log in the Output window to see which project causes the rebuilds. You might have to increase the amount of information in the build log: Open the menu Tools | Options... | Projects and Solutions | Build and Run and change the MSBuild project build output verbosity to Detailed.



XNA Installers
       If you have any trouble with finding the installation files on the web to download and install XNA, I have also provided them below:


Along with XNA installation files, this download also contains the following if you had any trouble above: 

Games for Windows Live Client
Windows Live Sign-In 
Windows Phone SDK 7.1


Important Note: Its not required but if you'd like, this guide created by Roy Triesscheijn that will provide you with a workaround for using XNA in Visual Studio 2017



MonoGame
       Like myself, there are lots of programmers still bitter about Microsoft's decision to shutdown XNA on PC and Xbox. If you have XNA projects and assets, the good news is they they can be transferred over to MonoGame which is a good stand in. Both Xbox One and Windows 10 support MonoGame. Check out the 2015 Build Conference video by Jaime Rodriguez and Brian Peek.  On March 14, 2016, ID@Xbox announced that MonoGame is coming to Xbox One. This was great news for XNA fans.


How to Setup MonoGame
       RB Whitaker's Wiki provides some awesome tutorials both for XNA and MonoGame. Go to the Setting Up MonoGame page to learn how to successfully install MonoGame. Check out this awesome video below by Chad Carter on upgrading XNA 3.1 to XNA 4.0 / MonoGame 3.5.1 / Universal Windows Platform.




Sources:
Stackoverflow: How to install XNA Game Studio on Visual Studio 2012: https://stackoverflow.com/questions/10881005/how-to-install-xna-game-studio-on-visual-studio-2012 


Justin Aquadro: XNA Templates for Visual Stuidio 2013: https://jaquadro.com/2014/02/xna-templates-for-visual-studio-2013/ 

Roy T.: Installing XNA 4 under Visual Studio 2017: https://roy-t.nl/2017/07/18/Installing-XNA-4-under-Visual-Studio-2017.html  



9 comments:

  1. This all seems like useful info, but are you sure you want to have instructions for cracking MSVS on your blog?

    ReplyDelete
    Replies
    1. Thank you for the comment Frank. To be honest, I was and am still very uncomfortable with sharing how to crack Visual Studio C# 2008 Express on my blog. Microsoft ended mainstream support for Windows 7 and my past serial key which I’ve had for a few years would not work on Windows 10. I’ve contacted help & support several times with no response. My only fear is that viewers will use the steps provided to somehow crack future versions of Visual Studio which was not my intention at all. My intention was to help devs revive their old XNA 3.1 games projects and get them to work on Windows 10. XNA 3.1 only runs on Visual Studio C# 2008 editions and I did so to keep all of my projects in one place for my needs.

      Delete
  2. I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. Bushing

    ReplyDelete
    Replies
    1. Thank you for your comment Jason! I greatly appreciate it and am glad others how found this post useful.

      Delete
  3. Cool you inscribe, the info is really salubrious further fascinating, I'll give you a connect to my scene. https://phys.org/news/2009-11-black-friday-students-iphone-barcode.html

    ReplyDelete
  4. Hi, I know this is an old post but I'm also looking to revive my old game projects written in XNA 3.1 and I wonder if this still works for you? I'm still on Windows 10 but when I try to install XNA 3.1 the Program Compatibility Assistant pops up with an error message that says: "This app can't run because it causes security or performance issues on Windows..."

    There's an option to override it and continue with the installation process for a bit but it invariably fails to install.

    ReplyDelete
    Replies
    1. Hello and my apologies for the late reply. I have seen the following error "This app can't run because it causes security or performance issues on Windows.." before.

      Try to Right-click the executable file of the app and select Properties. Open the Compatibility tab, check Run this program in compatibility mode for, and then use the drop-down menu to select a different Windows version. To save the new settings and try running the app, click Apply > OK.

      I hope it helps! Let me know the results.

      Also be sure to check out Nexlon's XNA 3.1 to 4.0 Cheat Sheet to convert your projects to XNA 4.0 here: https://jordonmd.blogspot.com/p/xna-31-to-40-cheatsheet.html

      Delete
    2. Absolutely no need to apologize, I'm happy to get a reply at all since this was such an old post.

      I tried to run the XNA 3.1 installer in compatibility mode for both WinXP and Win7, but I get the same error message followed by a failed installation.

      Just to be clear, does XNA 3.1 still work for you on the latest version of Windows 10? Because I've been wondering if there might have been some update to Windows since you wrote this blog post that could have broken compatibility with it.

      Delete
    3. Yes, it runs on my latest version of Windows 10. This could be a security issue. Try the following solution below:

      1.) Open your start menu.
      2.) In the search box, type Local Security Policy.
      3.) The Desktop App should display at the top, so left-click on that.
      4.) Go to the Local Policies folder and select Security Options in that folder.
      5.) Scroll down to User Account Control: Allow UIAccess applications to prompt for elevation without using the secure desktop.
      6.) Double-click this and select Enabled.
      7.) Select Apply and close out of the Local Security Policy.
      8.) Restart your computer and try re-installing the application again

      Creating a new administrator account should also help to further fix it. I hope this helps

      Delete