Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio
All postings are provided AS IS with no warranties, and confer no rights. Additionally, views expressed herein are my own and not those of my employer, Microsoft.
I posted some sample code a while back to demonstrate how to detect whether or not each version of the .NET Framework is installed, and if so, whether any service packs are installed. I only posted the source code for the samples. Since then, I've gotten a few questions about how to use Visual Studio to compile the code, so I decided to post the steps I use to create a Visual Studio project that can be used to compile the sample code:
<update date="11/12/2010"> Added a note about using the /MT command line switch to statically link to the Visual C++ runtime files to avoid dependency problems when running the sample code on other computers. </update>
Today, the XNA Game Studio team released a Japanese version of the XNA Game Studio 3.0 documentation. You can download the installer for this documentation from this location. It can be installed on any system that has Visual C# 2008 Express Edition or Visual Studio 2008 Standard Edition or higher installed. If you already have XNA Game Studio 3.0 installed on your system, you can install the Japanese documentation side-by-side and access both the English and the Japanese documentation in the help viewer.
If you read Japanese and would like to view the existing XNA Game Studio 3.0 help documentation in Japanese instead of (or in addition to) English, then I encourage you to download the XNA Game Studio 3.0 Japanese documentation installer and give it a try.
My colleague Michael Klucher posted some information on his blog today about an upcoming update that will be available soon for the XNA Game Studio Connect application. XNA Game Studio Connect is the component that you run on an Xbox 360 in order to deploy, debug, test and peer review Xbox 360 games created with XNA Game Studio.
After the release of Xbox LIVE Community Games last fall, we ran into a few issues where the behavior of the game when running in XNA Game Studio Connect didn't match the behavior after it is published and is run as a community game. As a result, there were a few scenarios that were not possible for the developer or peer reviewer to test before the game was published, and in some cases a game that appeared to run fine during peer review would crash after it was published.
The upcoming update to XNA Game Studio Connect is intended to make the experience of running the game during development and peer review more closely match the experience of running it after it is published. The update will be available in the next few weeks, and Michael includes more details about the changes that were made behind the scenes in his blog post so I encourage you to check that out as well.
Question:
I saw a couple of previous blog posts that you wrote about how to detect the presence of the Visual C++ 2005 runtime files and the Visual C++ 2005 SP1 runtime files. I am creating an installer that requires the Visual C++ 2008 runtime files. How can I detect the presence of the Visual C++ 2008 and 2008 SP1 runtime files?
Answer:
Like in the Visual C++ 2005 runtime files, there is not a specific detection mechanism designed and built into the Visual C++ 2008 runtime files installers. You can use an algorithm like the one I described in my previous blog posts to detect the presence of the Visual C++ 2008 runtime files products on a system:
Visual C++ 2008 runtime files
Visual C++ 2008 SP1 runtime files
Visual C++ 2008 SP1 ATL Security Update runtime files
Visual C++ 2008 SP1 MFC Security Update runtime files
<update date="11/19/2009"> Added information about the Visual C++ 2008 SP1 ATL Security Update product codes. </update>
<update date="11/7/2011"> Added information about the Visual C++ 2008 SP1 MFC Security Update product codes. </update>
Recently, we've heard from a few people via the Creators Club forums who have had trouble getting XNA Game Studio setup to run correctly. In a few cases, such as in this forum post, the setup program (named bootstrapper.exe) will crash shortly after double-clicking on the setup package to launch it.
If you run into this type of issue with XNA Game Studio 2.0 or 3.0 setup, you can use the following set of steps to bypass bootstrapper.exe and install the pieces of XNA Game Studio manually.
Update - now that XNA Game Studio 3.1 has shipped, I have created a new blog post with steps to manually install XNA Game Studio 3.1 in case anyone needs them.
To manually install XNA Game Studio 3.0
To manually install XNA Game Studio 2.0
If you end up running into this type of crash, before you proceed with one of the above workarounds, please collect a call stack with Visual Studio or Visual C# Express Edition and report a bug on the Connect site so that we can investigate it further.
<update date="5/15/2009"> Added instructions to skip installing some of the MSIs depending on what edition(s) of Visual Studio are installed on the system. </update>
<update date="6/12/2009"> Added a link to a new blog post about how to manually install XNA Game Studio 3.1. </update>
The .NET Framework 3.5 SP1 was released last fall along with Visual Studio 2008 SP1. The .NET Framework 3.5 SP1 installs the .NET Framework 2.0 SP2 and the .NET Framework 3.0 SP2 behind the scenes as prerequisites. Initially, the only way to get the .NET Framework 2.0 SP2 was to install the full .NET Framework 3.5 SP1 package.
Last week, a standalone installer package for the .NET Framework 2.0 SP2 was posted on the Microsoft Download Center. There are x86, x64 and ia64 versions of this package, and the package allows you to install the .NET Framework 2.0 SP2 on Windows 2000, Windows XP and Windows Server 2003 without needing to install any .NET Framework 3.0 or 3.5 packages.
There are a couple of important notes to keep in mind before downloading the .NET Framework 2.0 SP2 using the links below:
Here are links to download locations for the .NET Framework 2.0 SP2:
For the language packs, you will need to go to the above link and change the language drop-down to the language that you want to download the language pack for, then download the files listed in the language-specific version of the download page.
<update date="1/25/2009"> Added a note about the fact that the .NET Framework 2.0 SP2 is a slipstream package and can be installed on a system even if it doesn't already have the .NET Framework 2.0 on it. </update>
Windows Installer 5.0 will be included in Windows 7 and Windows Server 2008 R2. A beta version of the Windows 7 SDK was released last week to go along with the beta of Windows 7.
Bob Arnson recently announced on his blog that WiX v3.0 now includes support for new Windows Installer 5.0 features starting with the 3.0.4917.0 build on the SourceForge site.
Here are a couple of useful links to help getting started learning about the new features that will be available in Windows Installer 5.0.
Over the holidays, Stephen Styrchak wrote a tool to automate the process of exporting an XNA Game Studio 3.0 game project to a project template, and I wanted to link to some information about this tool to help raise awareness about it.
The built-in Visual Studio Export Template command does not work for XNA Game Studio projects, and Visual Studio also does not provide the necessary extensibility to allow us to modify the command so it will work correctly. A while back, Stephen wrote this blog post that explained a fairly complicated manual process that can be used to create custom project templates for XNA Game Studio projects. The tool he created automates those steps to make the process of creating custom XNA Game Studio project templates much easier.
You can find information about where to download the XNA Game Studio Project Template Exporter tool and how to use it in his blog post at http://badcorporatelogo.spaces.live.com/Blog/cns!43EB71B104A2D711!377.entry.
Over the holidays, I was asked by a friend to look at a problem they were running into on their Windows Vista system. They were unable to connect to Windows Update and check for updates and received a cryptic error message. After a few minutes of poking around on the system, I recognized a common set of symptoms that I had also seen on a couple of co-workers' systems a few weeks prior to that. I also recognized some symptoms that I've heard about from customers via my blog who had trouble getting the .NET Framework 3.5 to install on Windows Vista due to issues with the .NET Framework 2.0 SP1 and/or .NET Framework 3.0 SP1 OS update packages that it tries to install behind the scenes.
Since I had a system available to debug on, I ran through some troubleshooting steps that I've learned over the past couple of years related to Windows Vista OS update installation issues and identified several specific symptoms, and then eventually came up with a set of steps to fix this system. Then I came back to work after the holidays and tried out the steps on my co-workers' systems and found that the same basic set of symptoms and resolution steps worked there as well. As a result, I'm going to try to summarize these symptoms and the steps I used to resolve them in the hope that they might be helpful to others suffering from the same issues on their systems.
Symptoms of this problem
In the systems I've been able to find so far with this type of problem, I've observed a common set of symptoms.
Symptom 1: Blank Windows Features dialog
Going to the Programs and Features control panel and then clicking the link on the left labeled Turn Windows features on or off brings up the Windows Features dialog. This can also be launched directly by running OptionalFeatures.exe. In the error cases I've seen, the Windows Features dialog appears completely empty instead of listing all of the Windows components that can be enabled or disabled on the system.
Symptom 2: Blank list of installed updates
Going to the Programs and Features control panel and then clicking the link on the left labeled View installed updates brings up a list of installed service packs, updates and hotfixes for the OS and any applications installed on the OS. In the error cases I've seen, the list of installed updates was completely empty, even when I knew for sure that some OS updates had been installed on the system.
Symptom 3: Error when attempting to check for updates using Windows Update
Going to the Windows Update control panel and choosing the Check for updates link either reports an error message and an HRESULT code (for example, 0x80070005 or 0x80073712) or states that there were no updates available for the system.
Symptom 4: Hang or error when attempting to manually download and install OS updates
Bypassing the Windows Update control panel by going to the Microsoft support site and directly downloading and attempting to install a Windows OS update package results in the update hanging and failing to complete installation or the update reporting that it is not applicable on the current OS and exiting without installing.
I saw the latter behavior for the .NET Framework 3.5 on systems in this state. On Windows Vista, the .NET Framework 3.5 attempts to install the .NET Framework 2.0 SP1 OS update package (because the .NET Framework 2.0 is an OS component on Vista). When the systems I observed were in this broken state, the .NET Framework 2.0 SP1 failed to install, and I observed the following error in the .NET Framework 3.5 or 3.5 SP1 log file named %temp%\dd_dotnetfx35install.txt:
[08/08/08,11:11:11] Microsoft .NET Framework 2.0SP1 (CBS): ***ERRORLOG EVENT*** : Error: Installation failed for component Microsoft .NET Framework 2.0SP1 (CBS). MSI returned error code 1.
Error code 1 from the .NET Framework 2.0 or 3.0 CBS package means that the package is not applicable on the current OS.
Steps that might help resolve this problem
On the systems that I have been able to find in this state so far, I have used the following set of steps to get the system back into a working state so that it could display information in the Windows Features dialog, check for updates using Windows Update and successfully install OS updates. I have only been able to work with a few systems in this broken state though, so I'm not sure the same set of steps will always work. I wanted to post them here in case there are helpful in some cases though, but please keep in mind that your mileage may vary.
Note - I found another blog post with a more detailed step-by-step description about how to fix the Component Based Servicing registry keys. You can find that post at http://www.raymond.cc/blog/archives/2009/03/06/fix-blank-or-empty-list-in-vista-turn-windows-features-on-or-off-optionalfeaturesexe/.
Hopefully this set of steps will be helpful to some folks who run into this type of symptoms on their Windows Vista systems. Again, I want to emphasize that I've only been able to directly look at a few systems that exhibited this type of symptoms, so these steps may or may not help 100% of the time if you have a system in a similar state.
<update date="2/11/2009"> Updated list of steps to run the CheckSUR tool because the packaging for the tool has changed since the time I originally wrote this blog post. </update>
<update date="4/3/2010"> Added a link to a blog post with additional steps about how to fix the Component Based Servicing registry keys. </update>
As mentioned in the release notes for the WiX v3.0.4827.0 build, Bob Arnson has done some work to enable publishing of an online version of the WiX v3.0 documentation on the WiX SourceForge site. You can access the online WiX v3.0 help documentation at the following location:
http://wix.sourceforge.net/manual-wix3/main.htm
This online WiX help documentation allows you to quickly access WiX toolset usage information, WiX and WiX extension schema reference and how-to topics by going to http://wix.sourceforge.net/manual-wix3/main.htm and following the links there instead of needing to download the WiX binaries or install the WiX 3.0 MSI and browsing the wix.chm file. Selfishly, this will also allow me to link directly to WiX help topics in future blog posts that I write about using the WiX toolset.