Aaron Stebner's WebLog

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

How to work around Visual Studio 2005 and 2008 unattended install bug related to Windows Installer 3.1

How to work around Visual Studio 2005 and 2008 unattended install bug related to Windows Installer 3.1

  • Comments 20

While helping an internal Microsoft team work on deployment scripts to install Visual Studio 2008 to the systems in their test lab, we found a bug in the VS 2005 and VS 2008 unattended setup logic that I wanted to describe here and provide a workaround for.

Description of the issue

If you are creating and using an unattended INI file to deploy VS 2005 or VS 2008, and the target system is Windows XP or Windows Server 2003 and has a version of Windows Installer that is newer than version 3.1.4000.2435, then setup will incorrectly attempt to install Windows Installer 3.1 even though a later version is already on the system, and then eventually setup will fail silently.

For reference, VS 2005 and VS 2008 setup look at the file version of the file %windir%\system32\msi.dll to determine what version of Windows Installer is present on the system.

How to work around the issue

If you are running into this scenario while deploying VS 2005 and/or VS 2008, you can use the following steps to work around this issue:

  1. Launch Visual Studio 2005 or 2008 setup by running <VS install location>\setup\setup.exe /createunattend vs_unattend.ini
  2. Select the components that you want to install in the VS 2005 or 2008 setup feature 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 line gfn_mid windows installer 3.1
  5. Locate the [InstallOrder] section and remove the line gfn_mid windows installer 3.1
  6. Locate the [PostInstallOrder] section and remove the line gfn_mid windows installer 3.1
  7. Locate the [gfn_mid windows installer 3.1] section and change the line that says InstallActionInteger=5 to say InstallActionInteger=1
  8. Save and close the INI file
  9. Run <VS install location>\setup\setup.exe /unattendfile vs_unattend.ini

One additional note - if you are using the new silent install switches (/q and /full) to deploy VS 2008 instead of creating an INI file, then you will not see this behavior, even if you have a version of Windows Installer that is newer than 3.1.4000.2435 installed on your system.

<update date="2/4/2008"> This issue affects both VS 2005 and VS 2008, so I updated the text to indicate that it can happen for either product family. </update>


  • PingBack from http://msdnrss.thecoderblogs.com/2007/11/02/how-to-work-around-visual-studio-2008-unattended-install-bug-related-to-windows-installer-31/

  • Hi Aaron,

    I followed the /createunattend vs_unattend.ini method to install VS2008 unattended. That works, but the end-user has no idea about the progress of the installation because it's completely silent. So I digged a bit deeper into the msi and that's what I do now:

    msiexec /i vs_setup.msi /qb- ADDEPLOY=1 PIDKEY=<your_24_char_license_key>

    Of course you have to be sure all prereqs are met.


  • Hi LVDJEUGT - The command line you listed is essentially the standard Windows Installer unattended install switch.  That will work to install the main VS MSI (vs_setup.msi).  However, VS setup chains in many other things besides just this MSI, and this command line will only install the main VS MSI.  You will still need to install the prerequisites like you mention, but also need to install several other components that are installed after the main VS MSI is installed (things like the Windows SDK, Crystal Reports, SQL Express, etc).

    There is more information about the components installed during VS 2008 setup and silent install switches for all of them in the VS 2008 Deployment Readme at http://go.microsoft.com/fwlink/?LinkID=101063.

  • Hi Aaron,

    Thank you for the work-around!

    I noticed that running

    <VS install location>\setup\setup.exe /unattendfile vs_unattend.ini

    will result in an exit code of 1 even though visual studio 2005 was successfully installed.

    But I'm not sure if this is expected with this work-around or if setup.exe will always exit with code 1 regardless of this issue.

  • Hi Icnocop - I'm glad to hear that this work around was helpful to you.  The setup.exe process should not always return 1 in this unattended scenario though.  It should return 0 for success, 3010 for success with a reboot required and any other return value should indicate a failure.  The process exit code should also match what is listed at the end of %temp%\dd_install*.txt.  How are you launching the setup.exe process in your scenario, and what logic are you using to determine the exit code?  Also, does this behavior reproduce consistently for you?

  • Hi Aaron,

    I figured out why setup.exe was returning an exit code of 1.

    It is directly related to the other issue you reported, "How to fix Visual Studio 2005 unattended installs on Windows Vista",


    This issue also affects Windows XP if .Net 2.0 SP1 is already installed prior to running the unattended vs2005 installation.

    However, if only .Net 2.0 is installed (not SP1), I get an exit code of 0.


  • Hi Icnocop - That explanation makes sense.  The bug described in that other blog post causes Visual Studio setup to try to install a component even if it is already installed on the system.  In the case of the .NET Framework 2.0, if 2.0 SP1 or 2.0 SP2 is already installed, re-running the original 2.0 installer will fail, and that will cause the unattended VS install process to return a non-zero exit code like you were seeing.

  • The Microsoft Visual Studio 2008 Administrator Deployment Readme says that the fix above with resolve the problem:

    "setup installs pre-requisites and core VS components, but ignores all optional components following the core feature"

    But i have made the above changes and the Remote Debugger etc are still not installing

    (on windows 7x64)

  • Hi,

    I followed your other link


    as well as this one and resolved my problem


  • Hi Helenp1983 - I'm glad to hear that you were able to figure this out with the combination of the instructions in these 2 blog posts.  I'm sorry for the hassles getting everything working correctly though.

  • Hi astener,

    Although both of your post helped me instal Visula Studio 2008 on Windows 7 x64 (using SCCM)

    It didn't work for VS 2005 because of the "Program Compatibility Assistant warning"

    I tryed to slipstream SP1 and the Visual Studio 2005 Service Pack 1 Update for Windows Vista patch as per http://blogs.msdn.com/heaths/archive/2006/12/16/slipstreaming-visual-studio-2005-service-pack-1.aspx

    The prereq's installed, but the setup.exe then called the msi and it failed.

    So i tried disabled the Program Compatibility service and the warning still appeared.

    So i'm stuck!

  • Hi Helenp1983 - I'm not sure exactly what Program Compatibility warning dialog you are referring to here.  What is the exact text of the dialog that you see in this scenario?

    I'm not sure if it is the same as the one I wrote about at http://blogs.msdn.com/astebner/archive/2007/02/07/warning-dialog-appears-when-launching-visual-studio-2005-sp1-on-windows-vista.aspx, but it is worth taking a look at that blog post in case it is helpful to you in this scenario.

    It might also help to look at the Application Compatibility Toolkit described at http://technet.microsoft.com/en-us/windows/aa905066.aspx to see if it offers any options to help you suppress that dialog in this scenario.

  • No it was the last screen shot on this forum:


    I have written a script to silence the Program Compatibility Assistant warnings.

  • Thank you Aaaron, for your very helpful blogs and prompt response. I now have a successful depolyment setup for Visual sutdio 2008 & 2005 to Windows 7 x64 using sccm

  • Hi Helenp1983 - I'm glad to hear that you've gotten the deployment to work successfully.  If you have a chance, could you please share the script that you created to suppress the PCA warnings that you were seeing in this scenario in case others run into similar issues in the future?

Page 1 of 2 (20 items) 12
Leave a Comment
  • Please add 4 and 6 and type the answer here:
  • Post