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.
Note - I originally wrote this blog post when the Windows Phone Developer Tools Beta was released, but the information is also useful when trying to install the RTW version. I'm going to update some of the links from this post to point to the WPDT RTW version instead of the beta version.
As noted in my previous blog post, the Windows Phone Developer Tools RTW was released recently. Since the RTW version was released, we’ve heard from some people who have had problems uninstalling the previous WPDT CTP builds from their computer in order to be able to install the RTW version. There are 2 specific types of issues that I’ve seen, so I want to describe each of them in a bit more detail in case anyone reading my blog in the future runs into similar problems.
Issue 1 – WPDT CTP uninstall will not proceed due to missing components
In this scenario, the WPDT CTP or CTP Refresh uninstall process detects that some optional components (Silverlight 4 Tools, XNA Game Studio 4.0 and/or XNA Game Studio 4.0 Windows Phone Extensions) are not present, and it forces you to re-install those components before being allowed to uninstall the WPDT CTP.
In most cases, you can simply allow setup to re-download and re-install the missing components, then run setup again and uninstall the CTP. The steps to accomplish this are documented in this blog post. This post describes CTP uninstall, but equivalent steps can be used for CTP Refresh uninstall as well.
Sometimes, the re-download and re-install of these components can also fail. If you encounter this type of failure, you can download the XNA Game Studio cleanup tool and choose the option in that tool to uninstall the Windows Phone Developer Tools as a last resort. After the uninstall completes, you can proceed with the installation of the WPDT RTW.
Note – the underlying problem with WPDT setup that causes it to force you to re-install components in order to uninstall the product is a known bug that existed in the CTP and CTP Refresh and has been fixed in the Beta and in the RTW version. However, since the bug was present in the CTP Refresh, it still impacts scenarios where you try to uninstall the CTP Refresh in order to move forward to RTW. You should not see this type of issue when uninstalling the Beta or RTW versions of WPDT.
Issue 2 – WPDT RTW install will not proceed because of incompatible components
In this scenario, the WPDT RTW setup process blocks you from installing because it detects that incompatible components are still installed on your computer. In some cases, this can happen even after uninstalling the CTP builds as described above in Issue 1.
I use the steps like the following to diagnose and resolve this issue:
If you run into WPDT CTP uninstall issues or RTW install issues that are not solved by the above suggestions, you can use the log collection tool to gather your setup log files. This log collection tool will create a file named %temp%\vslogs.cab. This tool does not gather XNA Game Studio 4.0 setup log files, so if your setup failure is caused by the XNA Game Studio 4.0 component, you’ll need to gather those logs separately by zipping up all of the logs in the folder named %temp%\XNA Game Studio 4.0 Setup\Logs. Once you have gathered your setup log files, you can upload them to a file server of your choice (such as http://skydrive.live.com), and post a link to the log files in the forums or in a comment on my blog to get additional support.
<update date="7/13/2010"> Updated the link for uninstall steps to point at a new CTP Refresh-specific blog post instead of the old MIX CTP blog post. </update>
<update date="7/14/2010"> Added a note about where to find the blocking registry keys on 64-bit versions of Windows. </update>
<update date="10/14/2010"> Updated the post to refer to WPDT RTW instead of the WPDT beta. </update>
A couple of new knowledge base articles related to failed installations of .NET Framework 2.0, 3.0 and 3.5 hotfixes were published this week that I want to link to in order to hopefully help provide more visibility into the issues that they describe. You can find the articles at the following locations:
Summary of the issue
To summarize the issues described in these knowledge base articles, hotfixes for the .NET Framework 2.0, 3.0 and 3.5 can fail to install if the hotfix attempts to update an assembly that is installed in the global assembly cache (GAC) and that assembly is held in use with a hard lock by another application running on the system. To make matters worse, when a .NET Framework hotfix fails to install due to hard-locked files, the original file can end up being removed from the GAC entirely, which can cause .NET Framework applications to fail to run correctly on the system afterwards.
In general, hard locks are very rare and very few applications will load .NET Framework assemblies in a way that causes them to be hard-locked. There is a tool described in this blog post that can be used to simulate hard locks if you need to test this type of scenario.
This issue only affects hotfixes for MSI-based versions of the .NET Framework (so it will not affect the .NET Framework 2.0 or 3.0 on Windows Vista or the .NET Framework 2.0, 3.0 or 3.5 on Windows 7 for example).
How to diagnose the issue
In this type of scenario, you may see an error that looks like the following in the verbose log file for the .NET Framework hotfix (the exact file name in the error message will vary depending on what hotfix you are installing and what files are hard-locked):
07/01/10 11:30:00 DDSet_Error: Failed to install assembly 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.EnterpriseServices.dll' because of system error: The process cannot access the file because it is being used by another process. 07/01/10 11:30:00 DDSet_Error: Failed to install assembly 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.EnterpriseServices.dll' because of system error: Access is denied.
07/01/10 11:30:00 DDSet_Error: Failed to install assembly 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.EnterpriseServices.dll' because of system error: The process cannot access the file because it is being used by another process.
07/01/10 11:30:00 DDSet_Error: Failed to install assembly 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.EnterpriseServices.dll' because of system error: Access is denied.
If any files are removed from the GAC during the failing .NET Framework hotfix installation, the .NET Framework setup verification tool will report that one or more files is missing from your system.
How to resolve the issue
If you encounter this error, you can resolve it by doing the following:
The Windows Phone Developer Tools CTPs and Beta have only offered online documentation for general Windows Phone developer topics and Silverlight Windows Phone application development topics. However, it is possible to use the Visual Studio 2010 Help Library Manager to download an offline copy of the Windows Phone developer documentation. Here are the steps I’ve used to do this on my computer:
XNA Game Studio 4.0, which is installed as a part of the Windows Phone Developer Tools setup process, installs a CHM file with offline documentation, but the CHM file can only be launched via the shortcut on the Windows start menu (located at All Programs | Microsoft XNA Game Studio 4.0 | XNA Game Studio Documentation). The CHM cannot by pressing F1 while working on an XNA Game Studio project in the Visual Studio IDE.
We are planning to make the XNA Game Studio 4.0 documentation available for offline download via the Help Library Manager in the future. Once we do that, you will be able to download and install the documentation in the same way that I described above for the Windows Phone Development documentation. After installing the offline documentation using Help Library Manager, you will be able to access the documentation by pressing F1 while working on an XNA Game Studio project in the Visual Studio IDE.
<update date="7/30/2010"> Updated the first step in this post with an easier way to launch Help Library Manager. </update>
As announced on the Windows Phone Developer Blog, a Windows Phone Developer Tools (WPDT) Beta (which includes an XNA Game Studio 4.0 Beta as well) was released for download today.
Getting Started links
Here are links to help you get started installing and using the Windows Phone Developer Tools Beta:
Here are some links to useful documentation to help you get started with the Windows Phone Developer Tools Beta:
Here are some links if you run into questions or issues with the Windows Phone Developer Tools Beta:
How to install
Here are steps you can use to install the Windows Phone Developer Tools Beta:
If you encounter Windows Phone Developer Tools Beta setup failures
If you run into an installation or uninstallation failure for the Windows Phone Developer Tools Beta, you can use the log collection tool to gather your setup log files. This log collection tool will create a file named %temp%\vslogs.cab.
This tool does not gather XNA Game Studio 4.0 setup log files, so if your setup failure is caused by the XNA Game Studio 4.0 component, you’ll need to gather those logs separately by zipping up all of the logs in the folder named %temp%\XNA Game Studio 4.0 Setup\Logs.
Once you have gathered your setup log files, you can upload them to a file server of your choice (such as http://skydrive.live.com), and post a link to the log files in the forums to get additional support.
If you run into uninstallation issues with the WPDT CTP, CTP Refresh or Beta, you can use the cleanup tool described at http://blogs.msdn.com/astebner/pages/9544320.aspx to remove XNA Game Studio or the Windows Phone Developer Tools.
Peter Marcu has posted a new survey on his blog that I wanted to link to here in order to try to help him get more responses. He's looking for feedback about changes made to the setup and deployment experience for the .NET Framework 4 to help determine how to continue to improve the experience in future versions of the .NET Framework.
If you are a developer working on the deployment of applications that require the .NET Framework, I encourage you to check out his blog post at http://blogs.msdn.com/b/pmarcu/archive/2010/07/16/do-you-deploy-a-managed-app-part-2.aspx and post comments there or send him an email to share your experiences and suggestions for improvements.