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 (20)

  1. LVDJEUGT says:

    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

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

  3. icnocop says:

    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.

  4. 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?

  5. icnocop says:

    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.

    😉

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

  7. Helenp1983 says:

    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 7×64)

  8. Helenp1983 says:

    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

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

  10. Helenp1983 says:

    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!

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

  12. Helenp1983 says:

    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.

  13. Helenp1983 says:

    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

  14. 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?

  15. mstarks67 says:

    I am very interested in the solution Helenp1983 has found to install Visual Studio 2008 to Windows 7 x64 using SCCM 2007.  Once I install the prerequisites, the main installs starts, then bombs out.  I cannot figure it out for the life of me.  If I run the same command line installation manually, Visual Studio installs perfectly.  What am I missing?  I know this is an old thread, but still worth a try.

    Mike

  16. 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?

  17. mstarks67 says:

    astbner – Thank you for your offer, but I think I have resolved the issue.  For the longest time, I was trying to use an unattended setup with no luck.  After multiple failures, I stepped back and decided to try a different approach.  Since we needed the full version of VS2008 minus the SQL Express, I decided to strip out the 2 entries for SQL Express in the baseline.dat file and run a silent install.  That worked for a manual installation but the SCCM package failed.  Following a hunch, I removed the entries in the baseline.dat file for Windows Installer, Document Explorer, Web Developer Tools and 64-bit prerequisites), as they are installed prior to the VS 2008 package.  That seems to have done the trick as my SCCM package/task sequence is now working correctly.

  18. Vince Harron says:

    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.

  19. Hi Vince Harron – You will need to make sure that you update your unattended INI file for VS 2005 and VS 2008 using the instructions in this blog post and also the ones at blogs.msdn.com/…/515629.aspx.  This will prevent VS setup from trying to install components that are a part of your OS already.  Hopefully, your unattended installation will complete successfully after you do that.

Skip to main content