Partilhar via


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

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>

Comments

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

  • Anonymous
    June 26, 2008
    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. Luc

  • Anonymous
    June 26, 2008
    The comment has been removed

  • Anonymous
    November 22, 2009
    Hi Aaron, Thank you for the work-around! I noticed that running <VS install location>setupsetup.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.

  • Anonymous
    November 23, 2009
    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?

  • Anonymous
    November 24, 2009
    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", http://blogs.msdn.com/astebner/archive/2006/01/20/515629.aspx. 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. ;)

  • Anonymous
    November 25, 2009
    The comment has been removed

  • Anonymous
    March 07, 2010
    The comment has been removed

  • Anonymous
    March 11, 2010
    Hi, I followed your other link http://blogs.msdn.com/astebner/archive/2006/01/20/515629.aspx?CommentPosted=true#commentmessage as well as this one and resolved my problem helenp1983

  • Anonymous
    March 11, 2010
    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.

  • Anonymous
    March 15, 2010
    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!

  • Anonymous
    March 15, 2010
    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.

  • Anonymous
    March 16, 2010
    No it was the last screen shot on this forum: http://www.sevenforums.com/tutorials/70829-program-compatibility-assistant-enable-disable.html#post628395 I have written a script to silence the Program Compatibility Assistant warnings.

  • Anonymous
    March 17, 2010
    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

  • Anonymous
    March 17, 2010
    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?

  • Anonymous
    December 01, 2010
    The comment has been removed

  • Anonymous
    December 01, 2010
    Hi Mstarks67 - I don't have any specific details from Helenp1983 about what they had to do to make the install work correctly from SCCM.  If you'd like, I can try to take a look at your setup log files and see if I can help narrow down the root cause of the installation failure.  Can you please use the tool described at blogs.msdn.com/.../6458047.aspx to gather your setup log files, upload the file named %temp%vslogs.cab that this tool will create on a file server (such as http://skydrive.live.com) and reply back here with a link I can use to download your logs and take a further look?

  • Anonymous
    December 14, 2010
    The comment has been removed

  • Anonymous
    August 19, 2011
    I can get /unattendfile working for vs2010 on Windows 2008 R2 but I can't get it to work for 2005/2008.  It just churns for a while and quits without installing anything.  setup /q /full works with vs2008 though.

  • Anonymous
    August 21, 2011
    The comment has been removed