Technorati Profile Troubleshooting the MVC installer for Visual Studio 2010 Beta 1 - Jacques Eloff

Troubleshooting the MVC installer for Visual Studio 2010 Beta 1

Today, MVC for Visual Studio 2010 Beta 1 was announced. You can find more details about it on Phil’s post. For the better part of the last month I’ve done little except churn out new installers for MVC, so I’m really happy to finally see one of them going out the door instead of heading to my recycle bin. The first thing you will probably notice when running the new installer, apart from the version number being 1.1, is that it is now a self-extracting EXE as opposed to just being a single MSI.

This change came about as we started to integrate MVC into the setup code of Visual Studio 2010. Including MVC required us to make changes to our own setup code and as a result we ended up with two MSIs; one for the runtime and another for the tooling components. This solved the problem of including MVC in post Beta 1 versions, but we still had to provide an out of band (OOB) installer for Beta 1 while keeping the CTP releases for the next version of MVC in our sights as well.

Chaining two MSIs so that the first installer calls msiexec to install the second is impossible because Windows Installer prohibits running installs in parallel (at least on versions prior to 4.5). We examined various options to provide a simple user experience for installing the two MSIs on Beta1. Downloading separate MSIs was never really an option because as we start making CTP releases of the next version we don’t want users to end up with the runtime component of one preview and the tooling component of another release.

The first attempt produced a chained installer (bootstrapper) using the setupbld.exe utility provided by WiX 3.0. It works really well, but did not quite fit our needs. For those of you that are using WiX to author setup programs, the roadmap for version 3.5 includes a new utility called Burn that will provide rich functionality for creating chained setup programs. Even though we ended up throwing this installer away it did have some benefits and we upgraded our build scripts to the latest version of WiX.

Attempt number two saw the creation of a the self-extracting EXE using the GenerateBootstrapper task and relies on some of the ClickOnce functionality used to describe the products and packages that comprise the installation manifest. To keep things simple, our EXE does not download the individual MSIs from a server. Instead, we just included them within the EXE.

I could have completed the second installer much sooner. In December when we were wrapping up RC1 we began looking at servicing scenarios for MVC using Windows Update (WU) and Microsoft Update (MU). As part of the investigation I split the MSI and created a self-extracting EXE. Eventually the effort was abandoned since we felt confident that we could service MVC by releasing a patch should the need arise and it was a better fit for MVC’s OOBness. I packed the code away just in case something changed for RTM, but soon after 1.0 was released I deleted it to get my machine cleaned out in preparation for the next version of MVC (note to self: Never throw away code).

Because our installation methodology has changed, troubleshooting failed installations is slightly different compared to MVC 1.0, but I hope to provide some useful tips on where to find information when things do go wrong.

What does the new installer do?

When you run AspNetMVC1.1_VS2010.exe it will extract a number of files to a randomly named folder under %temp% (usually located at AppData\Local\Temp). In my case the files were extracted to AppData\Local\Temp\VSDC164.tmp\. Within this folder you will find subfolders that are created for each MSI in the bootstrapper’s manifest. The following files should be present in either the root folder or one of the subfolders:

  • AspNetMVC1.1.msi
  • VS2010ToolsMVC1.1.msi
  • Setup.exe
  • Eula.rtf

Once the files are extracted, Setup.exe simply installs each MSI sequentially by calling msiexec using the /i and /q options.

Crash, Boom, Bang

When the EXE fails you should see a dialog similar to the one below. Note that I expanded the Details section (and sanitized some information).

bootstraperror

Take note of the log file being mentioned at the bottom of the dialog. This file is generated by the bootstrapper, not msiexec. The file is not too interesting, but does tell a sad tale about how msiexec is invoked:

Installing using command 'C:\Windows\SysWOW64\msiexec.exe' and parameters ' -I "C:\Users\*\AppData\Local\Temp\VSDC164.tmp\MvcRuntime\AspNetMVC1.1.msi" -q '

As you can see, the EXE simply performs a silent install and does not create a verbose log file. The default MSI log file generated by the bootstrapper contains very little information. In fact, if the install fails, you probably won’t see more than the excerpt below. This error was induced by running an unsigned installer on Windows Server 2008 and the installation failed when it tried to run NGEN on the unsigned System.Web.Mvc assembly.

Error 1937. An error occurred during the installation of assembly 'System.Web.Mvc,version="1.1.0.0",culture="neutral",publicKeyToken="31BF3856AD364E35",processorArchitecture="MSIL"'. The signature or catalog could not be verified or is not valid. HRESULT: 0x80131045. assembly interface: IAssemblyCacheItem, function: Commit, component: {32E5FFC3-0CDC-43C1-A5F8-62CAF64F3064}
=== Logging stopped: 6/5/2009  10:03:51 ===

Can you get more verbose logs? Yes. To do that, simply add the entry below to your registry and run the EXE again. For more details on the various options you can consult this KB article.

Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Installer

Value Name: Logging

Type: REG_SZ

Data: voicewarmupx

The MSI log file that’s produced by this registry entry is extremely verbose. Remember to remove the registry entry when you are done because Windows will continue to produce log files whenever you install a product and this may impact on install times for large products. One drawback of using this approach to create log files is that you end up with a totally random file name. For example, when I ran the EXE, the log that was produced was located in AppData\Local\Temp\MSI4ced1.LOG. The easiest way to find the log is to look at the timestamps of the files. For the more adventurous amongst us, delete all the MSI*.LOG files in %temp% before running the setup program.

Analyzing Install Logs

The Windows Installer 4.5 SDK provides a utility, wilogutl.exe, that can be used to analyze install logs. Simply launch the EXE, open the log file and click on the Analyze button. It won’t always solve your installation problems, but it’s always good to have another tool at the ready to troubleshoot problems. If nothing else, the tool can assist you to quickly step through a log and identify all the points of failure. The utility provided the following feedback for the log file from my failed installation.

wilogutl

Ultima Ratio

There is one final option available to troubleshoot a failed installation. Recall that when run, the EXE first extracts all the MSI files to your %temp% folder. Simply install the MSIs separately; runtime first, then the tooling components. Although this will not make any failures disappear, it should make it easier for you to determine which component (runtime or tools) is responsible for the installation failure.

Known Issues and Improvements

As much as I hate to admit it, there are some problems with the installer. While testing the installer it was discovered that even if you don’t have Visual Studio installed you will still get an entry under ARP for Microsoft Visual Studio 2010 Tools for ASP.NET MVC 1.1. The reason for this is that the bootstrapper does not check whether Visual Studio is installed. The MSI on the other hand does perform this check. However, when the MSI fails to detect a valid version of Visual Studio, it only disables some features inside the MSI, hence the entry under ARP still appears because the MSI does complete. Kudos to our testers for discovering this. We have a fix ready to address the problem, but schedules prohibited it from going into the build we released.

Noticed the double “Setup” in the error dialog I showed earlier? I’ve rewarded myself by opening a bug just for this.

I’m also not too happy about requiring users to tweak the registry to get verbose setup logs. Suffice it to say that I am looking at ways to introduce a static location, or at the very least a static log filename, so that users will not need to fiddle with the registry in upcoming CTP releases of MVC. My initial investigation seems to indicate that we might run into OS dependencies for this, but let’s see what can be done.

Have fun with the installer and let us know if you run into problems.

Comments

# Troubleshooting the MVC installer for Visual Studio 2010 Beta 1 - Jacques Eloff

Tuesday, June 09, 2009 5:52 PM by DotNetShoutout

Thank you for submitting this cool story - Trackback from DotNetShoutout

# Creating an MVC Project in Visual Studio 2010 | SquaredRoot

Pingback from  Creating an MVC Project in Visual Studio 2010 | SquaredRoot

# ASP.NET MVC: For Visual Studio 2010 Beta 1

Wednesday, June 10, 2009 3:21 AM by #Rui

La beta de Visual Studio 2010 n'est pas livrée avec les addon ASP.NET MVC comme ont pu le constater ceux

# Daily tech links for .net and related technologies - June 10, 2009

Wednesday, June 10, 2009 8:53 AM by Sanjeev Agarwal

Daily tech links for .net and related technologies - June 10, 2009 Web Development Introduction to StructureMap

# ASP.NET MVC For Visual Studio 2010 Beta 1 Released | AzureJournal - Cloud Computing Blog

Pingback from  ASP.NET MVC For Visual Studio 2010 Beta 1 Released | AzureJournal - Cloud Computing Blog

# Creating an MVC Project in Visual Studio 2010

Thursday, June 11, 2009 4:24 AM by VS2010学习

Earlier today Phil Haack announced that the Asp.Net MVC installer for Visual Studio 2010 Beta 1 is now

# re: Troubleshooting the MVC installer for Visual Studio 2010 Beta 1

Thursday, June 11, 2009 10:09 PM by Jesse

I cannot uninstall the mvc 1.1 component. I wanted to downgrade my visual studio team edition to professional. Unfortunately something went wrong, I cannot install visual studio 2010 now, nor can I remove mvc 1.1. What do I do beside reinstall windows?

# re: Troubleshooting the MVC installer for Visual Studio 2010 Beta 1

Thursday, June 11, 2009 11:04 PM by jeloff

@Jesse

What sort of error are you receiving when you try to uninstall MVC. MVC 1.1 creates two entries under ARP. You first need to uninstall Microsoft Visual Studio 2010 Tools for MVC 1.1, then uninstall ASP.NET MVC 1.1 (this is the runtime component).

# ASP.NET MVC installer for Visual Studio 2010 Beta 1

Saturday, June 13, 2009 8:51 AM by Gunnar Peipman's ASP.NET blog

Phil Haack announced Tuesday availability of ASP.NET MVC installer for Visual Studio 2010 Beta 1 . Referenced

# re: Troubleshooting the MVC installer for Visual Studio 2010 Beta 1

Monday, June 15, 2009 3:58 PM by Micheal Howard

Installed succesfully on Windows Server Ent 2008 R2 and VS 2010 Beta 1. First time.

# re: Troubleshooting the MVC installer for Visual Studio 2010 Beta 1

Monday, June 15, 2009 4:07 PM by jeloff

@Micheal

Awesome. Let me know if you encounter any issues.

# re: Troubleshooting the MVC installer for Visual Studio 2010 Beta 1

Tuesday, June 30, 2009 1:26 AM by Matt

Any tips for getting it to install on Win7RC AMD64?  I get no failure message, and there's nothing obvious in the Installer logs.

# re: Troubleshooting the MVC installer for Visual Studio 2010 Beta 1

Tuesday, June 30, 2009 1:35 AM by Matt

Re: my above comment.  I actually think it succeeded.  I expected to get a dialog box saying the installation completed.  I never got one, but it appears to work.

# re: Troubleshooting the MVC installer for Visual Studio 2010 Beta 1

Tuesday, June 30, 2009 2:08 AM by jeloff

@Matt

Yes, that's something we're working on. The UI that the installer had in 1.0 is suppressed, but we're hoping to update the bootstrapper to include a dialog similar to the final dialog we used in 1.0. Great to hear it's running on Win7 RC. If you ever run into something that looks like a silent failure then take a look at Add/Remove Programs first.

# re: Troubleshooting the MVC installer for Visual Studio 2010 Beta 1

Saturday, July 25, 2009 8:05 AM by Marius

I have installed it successfully, but where are the templates of MVC projects because I can't find them...

# re: Troubleshooting the MVC installer for Visual Studio 2010 Beta 1

Monday, July 27, 2009 12:24 PM by jeloff

@Marius

Hi Marius

The templates install to exactly the same folders under Dev10 as they do under 2008. If VS is open during MVC's installation, then it may result in problems. Are you just not seeing the templates when you try to create a new project?

# re: Troubleshooting the MVC installer for Visual Studio 2010 Beta 1

Wednesday, August 19, 2009 1:56 PM by Sekhar

Oh my god. Please help me with this installation. I am unable to install the tools on VS 2010 beta1 / windows 7 RTM

It worked great on windows 7 RC. Not sure why it doesnt work now

# re: Troubleshooting the MVC installer for Visual Studio 2010 Beta 1

Wednesday, August 19, 2009 6:42 PM by jeloff

@Sekhar

Do you have an install log for the tools installation?

# re: Troubleshooting the MVC installer for Visual Studio 2010 Beta 1

Thursday, October 22, 2009 4:36 PM by Yarx

Any idea why MVC 1.1 would refise to uninstall. It claims I have to uninstall the tools component, but I have done that, and it stills claims I have to do that step first. the log from the failed uninstall is useless since this is all it states

Please uninstall the Microsoft Visual Studio Tools component for MVC before uninstalling Microsoft ASP.NET MVC 1.1.

=== Logging stopped: 10/22/2009  14:11:16 ===

I've re-installed both the runtime and the tools, uninstalled the tools and still can't uninstall the runtime? Any ideas?

# re: Troubleshooting the MVC installer for Visual Studio 2010 Beta 1

Thursday, October 22, 2009 5:03 PM by jeloff

@Yarx

Try deleting HKLM\SOFTWARE\Microsoft\ASP.NET\MVCTools 1.1 from the registry. Then uninstall tools followed by runtime.

# re: Troubleshooting the MVC installer for Visual Studio 2010 Beta 1

Friday, October 23, 2009 6:08 PM by Marcus

@Yarx

If you're running Win7 x64 (as I am), then you need to remove the key "HKLM\SOFTWARE\Wow6432Node\Microsoft\ASP.NET\MVCTools 1.1". Seems like the uninstaller doesn't do this on x64 installations.

Leave a Comment

(required) 
(required) 
(optional)
(required)