Aaron Stebner's WebLog

Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio

January, 2009

  • Aaron Stebner's WebLog

    Mailbag: How to detect the presence of the Visual C++ 9.0 runtime redistributable package

    • 33 Comments

    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:

    1. Call the MsiQueryProductState API
    2. Pass in the product code for the package that you want to detect based on the list below
    3. Check the return value of this API.  If it is anything other than INSTALLSTATE_DEFAULT, the package is not yet installed

    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>

  • Aaron Stebner's WebLog

    Steps that might help fix Windows Update errors and a blank Windows Features dialog in Windows Vista

    • 6 Comments

    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.

    1. Download the System Update Readiness Tool and save the .msu file to your desktop.  You need to make sure to download the correct version of this tool because there is a different version for each OS type and processor architecture.  You can find the download links for this tool in this knowledge base article.

    2. Run the System Update Readiness Tool.  Once you download the appropriate .msu file for your OS type and processor architecture, you can double-click on it to install it.  This tool is not an OS update, but it uses the .msu packaging logic that OS updates use.  Therefore, it will tell you that it is installing the package, but it is actually running the tool in the background.  When the tool is running, you will see processes named checksur.exe, checksurlauncher.exe and checksurpackage.exe listed in Task Manager.

      Note: The tool attempts to fix any problems that it finds on the system.  However, it was not able to fix the problems it found on the systems that I have seen that experienced this type of problem.  It is still useful to run the tool in order to create a log file that lists the issues it finds.

    3. Look at the output in the CheckSUR.log file and make fixes based on what the tool reports.  The checksur.exe tool created a log file at the following location: %windir%\Logs\CBS\CheckSUR.log.  On the systems that I have seen this type of problem on, the CheckSUR.log reported problems with some of the registry values located under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages on the system.  I used the information in CheckSUR.log to locate and manually delete keys with errors reported for them.  On one of the systems, some of the sub-keys only had permissions assigned to them for the local system account, so I had to add the Administrators group and then delete them.  On one of the other systems, some of the sub-keys were reported as orphaned from some previous OS update that had been installed on the system, so I manually deleted them.

      One very important note here - I strongly recommend making a backup of your registry before trying to manually change any of the sub-keys under this HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages key.  This sub-key contains information that is usually only modified by installing and uninstalling OS update packages, so it is possible to cause problems with the OS if you delete keys that are still needed.  If you do not feel comfortable manually backing up and modifying your registry, then I instead recommend that you try to repair your OS by re-running OS setup using your original OS installation disc.

    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>

     

  • Aaron Stebner's WebLog

    Links to standalone .NET Framework 2.0 SP2 core and language pack installer packages

    • 5 Comments

    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:

    • There is not a standalone package for the .NET Framework 2.0 SP2 for Windows Vista or Windows Server 2008.  In order to install the .NET Framework 2.0 SP2 on those operating systems, you will still have to install the .NET Framework 3.5 SP1.
    • The .NET Framework 2.0 SP2 is a slipstream package.  This means it will install the .NET Framework 2.0 and the SP2 updates in a single package.  It will also automatically uninstall the .NET Framework 2.0 or 2.0 SP1 if you already have them installed.  If your system does not yet have the .NET Framework 2.0 at all, you can directly install the .NET Framework 2.0 SP2 without installing any other .NET Framework 2.0 packages.

    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>

     

  • Aaron Stebner's WebLog

    How to create a Visual Studio project to compile the sample .NET Framework detection code

    • 5 Comments

    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:

    1. Start Visual Studio 2005 or Visual Studio 2008
    2. Click on the File menu, choose New | Project...
    3. In the Visual C++ node, select the Win32 project item, enter a project name and click OK
    4. Choose Windows Application in the wizard
    5. Right-click on your project in the Visual Studio solution explorer and choose Properties
    6. In the property pages, change the Configuration dropdown at the top from Active (Debug) to All Configurations
    7. Go to Configuration Properties | C/C++ | Precompiled Headers and change the Create/Use Precompiled Header from Use Precompiled Headers to Not Using Precompiled Headers
    8. Go to Configuration Properties | C/C++ | Command Line and add the /MT command line switch to the Additional options text box
    9. Click OK to dismiss the property pages
    10. Replace the contents of your main CPP file with the contents of one of the 2 sample code files described in this blog post
    11. Save all of the project files
    12. Build the project

    <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>

     

  • Aaron Stebner's WebLog

    Online WiX 3.0 help documentation now available on the WiX SourceForge site

    • 2 Comments

    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.

  • Aaron Stebner's WebLog

    Windows Installer 5.0 support now available in WiX v3.0

    • 1 Comments

    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.

  • Aaron Stebner's WebLog

    Japanese documentation for XNA Game Studio 3.0 now available for download

    • 1 Comments

    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.

  • Aaron Stebner's WebLog

    Link to information about a tool to create custom game project templates in XNA Game Studio 3.0

    • 0 Comments

    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.

  • Aaron Stebner's WebLog

    Steps to install XNA Game Studio 2.0 and 3.0 without using the setup bootstrapper

    • 0 Comments

    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

    1. Download xnags30_setup.exe and save it to your hard drive
    2. Run xnags30_setup.exe /x to extract the contents to a folder of your choosing
    3. Go to the folder you extracted to in step 2 and run the MSI named redists.msi
    4. Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v3.0\Setup\XLiveRedist.msi
    5. Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v3.0\Redist\XNA FX Redist\xnafx30_redist.msi
    6. Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v3.0\Setup\xnaliveproxy.msi
    7. Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v3.0\Setup\xnags_platform_tools.msi
    8. Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v3.0\Setup\xnags_shared.msi
    9. Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v3.0\Setup\platformer.msi
    10. Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v3.0\Setup\xnags_documentation.msi
    11. (skip this step if you do not have Visual C# 2008 Express Edition installed) Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v3.0\Setup\xnags_vcsexpress.msi
    12. (skip this step if you do not have Visual Studio 2008 Standard Edition or higher installed) Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v3.0\Setup\xnags_devenv.msi
    13. Go to the folder you extracted to in step 2 and run the MSI named arpentry.msi

    To manually install XNA Game Studio 2.0

    1. Download xnags20_setup.exe and save it to your hard drive
    2. Run xnags20_setup.exe /x to extract the contents to a folder of your choosing
    3. Go to the folder you extracted to in step 2 and run the MSI named redists.msi
    4. Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v2.0\Setup\XLiveRedist.msi
    5. Run the EXE at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v2.0\Redist\DX Redist\DXSETUP.exe
    6. Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v2.0\Redist\XNA FX Redist\xnafx20_redist.msi
    7. Go to the folder you extracted to in step 2 and run the MSI named xnaliveproxy.msi
    8. Go to the folder you extracted to in step 2 and run the MSI named xnags_shared.msi
    9. Go to the folder you extracted to in step 2 and run the MSI named spacewar.msi
    10. Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v2.0\Setup\xnags_documentation.msi
    11. (skip this step if you do not have Visual C# 2005 Express Edition installed) Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v2.0\Setup\xnags_vcsexpress.msi
    12. (skip this step if you do not have Visual Studio 2005 Standard Edition or higher installed) Run the MSI at %ProgramFiles%\Microsoft XNA\XNA Game Studio\v2.0\Setup\xnags_devenv.msi
    13. Go to the folder you extracted to in step 2 and run the MSI named arpentry.msi

    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>

     

  • Aaron Stebner's WebLog

    New version of XNA Game Studio Connect will be available soon

    • 0 Comments

    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.

Page 1 of 1 (10 items)