How to fix Visual Studio 2005 unattended installs on Windows Vista

We found an issue over the holidays related to unattended installations of Visual Studio 2005 on Windows Vista. This issue was reported by a Microsoft employee trying to create a script to deploy Visual Studio 2005 in a lab of computers running Windows Vista. What he found is that creating the unattended INI file on Windows Vista incorrectly detects that it needs to install the .NET Framework 2.0, and then the installation fails because the .NET Framework 2.0 is already installed as part of the OS on Vista.

In order to workaround the issue we found, you will need to use the following steps to deploy Visual Studio 2005 using unattended mode on Windows Vista:

  1. Launch Visual Studio 2005 setup on a Windows Vista machine that does not already have VS 2005 installed by running <VS install location>\setup\setup.exe /createunattend vs_2005_vista.ini
  2. Select the components you want to install in the VS setup selection tree and save the INI file
  3. Open the INI file in a text editor such as Notepad
  4. Locate the [PreInstallOrder] section and remove the lines gfn_mid framework, gfn_mid framework ia64 and gfn_mid framework amd64
  5. Locate the [InstallOrder] section and remove the lines gfn_mid framework, gfn_mid framework ia64 and gfn_mid framework amd64
  6. Locate the [PostInstallOrder] section and remove the lines gfn_mid framework, gfn_mid framework ia64 and gfn_mid framework amd64
  7. Locate the [gfn_mid framework] section and change the line that says InstallActionInteger=5 to say InstallActionInteger=1
  8. Locate the [gfn_mid framework ia64] section and change the line that says InstallActionInteger=5 to say InstallActionInteger=1
  9. Locate the [gfn_mid framework amd64] section and change the line that says InstallActionInteger=5 to say InstallActionInteger=1
  10. Save and close the INI file
  11. Run <VS install location>\setup\setup.exe /unattendfile vs_2005_vista.ini

Important notes about the above steps:

  • Please note the folder location in the command line to run both /createunattend and /unattendfile mode. Those parameters only work for the copy of setup.exe in the setup subfolder. They do not work for the copy of setup.exe in the root of the installation disc.
  • You must create the INI file on the same OS that you plan to install it on. For example, you cannot create an INI file on Windows XP and then install using that INI file on Windows Vista.
  • You can use the steps listed in this blog post to stage Visual Studio 2005 on a network and chain MSDN setup after VS setup if desired.

These steps have been documented in the online version of the Visual Studio 2005 administrator mode readme. Note that this item was added after VS 2005 shipped, so if you look at the copy of the administrator mode readme located at \setup\adminreadme.htm on your VS 2005 installation disc, you will not see this additional note about Windows Vista.

The underlying bug in Visual Studio unattended mode is that it tries to re-install a component even if it is already on the system. Since the .NET Framework 2.0 is already present as an OS component on Windows Vista, this will cause Visual Studio unattended setup to fail. This issue can also affect Windows XP and other non-Vista operating systems if the .NET Framework 2.0 SP1 or .NET Framework 2.0 SP2 are already installed on the computer. If you are running Visual Studio setup in unattended mode on Windows XP or Windows Server 2003 and that system already has the .NET Framework 2.0 SP1 or 2.0 SP2 installed, then you will need to use the workaround listed in this blog post there as well.

<update date="11/25/2009"> Added a note about how this scenario can affect other operating systems besides Windows Vista. </update>