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>


 

Comments (29)

  1. Question:

    I tried to install Visual Studio 2005 using the unattended installation instructions that…

  2. I have previously posted instructions for performing a silent installation for Visual Studio 2005 and…

  3. This guide is intended to serve as a collection of links to articles, tools, tips and tricks that explain…

  4. Recently, a fellow employee contacted me with a question about unattended installation of Visual Studio

  5. This guide is intended to serve as a collection of links to articles, tools, tips and tricks that explain

  6. Helenp1983 says:

    Visual studio 2008 = gfn_mid net framework  

  7. Zaheer says:

    Hi Aaron..Its really useful information on Unattend file. I have one more query here with respect to the silent Installation of the Visual Studio 2005 on Windows 7 (32Bit) using Unattend file.The installation goes very fine in silent mode but at one point It stops with the Popup "this program has a known compatibilty issues with this version of Windows" when I click Run Program ignoring the message the rest of the installation again will continue in silent mode.I just want to know how to suppress this message during silent installation.I want that the end user should not get this popup during the silent installation.

  8. Hi Zaheer – You will need to use a technique like the one described in the blog post at blogs.msdn.com/…/how-to-automatically-suppress-application-compatibility-warnings-on-windows-vista.aspx to suppress this type of compatibility warning dialog during Visual Studio 2005 setup on Windows Vista and Windows 7.

  9. vs2005 setup.exe doesn't finish on unattended install on Windows 7 says:

    Hi Aaron,

    Firstly, thanks for your great posts – we wouldn't have made it this far if it wasn't for your excellent website!

    However, we're still stuck… Or at least the setup.exe for VS2005 is…

    We've followed the instructions on your website and others, and VS2005 seems to install correclty using an unattend ini on both Windows 7 x86 and x64, however the setup.exe continues to run in the backgroup, and our deployment system (Altiris) therefore presumes the job hasn't finished. Perhaps it hasn't?

    I can find anything particular in the logs, so was wondering if we could send you the logs and our set-up routines?

    Many thanks,

    RL

  10. Hi VS 2005 setup.exe doesn't finish on unattended install on Windows 7 – There are a couple of issues that I know of that could cause problems here.  The .NET Framework 2.0 SP2, 3.0 SP2 and 3.5 SP1 are installed as a part of the OS on Windows 7, so you need to make sure to update your unattended INI file to exclude the step to install the .NET Framework 2.0.  There is also a problem with the Windows Installer 3.1 component that is described at blogs.msdn.com/…/5846181.aspx, so you will need to update your unattended INI file to exclude that component as well – there are steps explaining how to do that in that other blog post.

    Hopefully, the installation will complete as expected once you make both of those changes to the INI file.  If not, please use the tool described at blogs.msdn.com/…/6458047.aspx to collect all of your Visual Studio setup log files, upload the file named %temp%vslogs.cab that this tool will create to a file server (such as http://skydrive.live.com) and reply back here and post a link I can use to download your log files and take a closer look.

  11. RL says:

    Hi Aaron,

    No cigar on setup.exe not finishing. I'm going to let it run overnight, but in the meantime here's the routine we use to create the installation. I'll send the log files tomorrow. Thanks, John…

    1. Download Visual Studio 2005 MSDN ISO

    2. Using WinRAR extract the Visual Studio 2005 MSDN ISO installer to: \servershareAppsWinx86VisualStudioVisualStudio_2005ProVendorSource

    3. Download Visual Studio Service Pack 1 (VS80sp1-KB926601-X86-ENU.exe)

    4. Using WinRAR extract Visual Studio Service Pack 1 to: \servershareServicePacksAndHotfixesWin32-bitWindowsVisualStudioVisualStudio2005SP1

    5. Download Visual Studio 2005 Service Pack 1 Update for Vista  (VS80sp1-KB932232-X86-ENU.exe)

    6. Using WinRAR extract Visual Studio 2005 Service Pack 1 Update for Vista  (VS80sp1-KB932232-X86-ENU.exe) patch to: \servershareServicePacksAndHotfixesWin32-bitWindowsVisualStudioVisualStudio2005PostSP1_KB929470

    7. Create batch file called ‘CreateVS2005RLAdminInstall.bat’ with the following text and run as an administrator:

    @ECHO OFF

    ECHO Mapping drive to deploy share

    Net use z: \servershare

    ECHO Creating folder structure

    Mkdir z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesdatafiles

    Mkdir z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvs

    Mkdir z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packageslogs

    cls

    ECHO Creating Transform file

    Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevsSetupsetup.exe /CreateTransform z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesdatafilesvs2005.mst

    ECHO GUI install choices For the MST…

    ECHO 1. Do not send data to Microsoft

    ECHO 2. Accept the Terms and Conditions

    ECHO 3. Choose FULL Install and leave the default install directory

    Pause

    ECHO Creating an admin install point

    Msiexec /a Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevsvs_setup.msi /L*vx z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packageslogsvsinstall.log TRANSFORMS=z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesdatafilesvs2005.mst TARGETDIR=z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvs

    ECHO Slipstream extracted Visual Studio Service Pack 1 into the admin installation directory

    Msiexec /a z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvsvs_setup.msi /p z:ServicePacksAndHotfixesWin32-bitWindowsVisualStudioVisualStudio2005SP1VS80sp1-KB926601-X86-ENU.msp /L*vx z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packageslogsvssp1.log

    ECHO Slipstream extracted Visual Studio Service Pack 1 Update for Vista into the admin installation directory

    Msiexec /a z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvsvs_setup.msi /p z:ServicePacksAndHotfixesWin32-bitWindowsVisualStudioVisualStudio2005PostSP1_KB932232VS80sp1-KB932232-X86-ENU.msp /L*vx z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packageslogskb932232.log

    ECHO Copying DVD Source files to admin installation directory

    XCOPY Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevssetup*.* Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvssetup /E /H /R /Y

    Copy Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevsautorun.exe Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvs /Y

    Copy Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevsautorun.inf Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvs /Y

    Copy Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevscontents.htm Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvs /Y

    Copy Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevshtmllite.dll Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvs /Y

    Copy Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevslocdata.ini Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvs /Y

    Copy Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevsmsvcp80.dll Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvs /Y

    Copy Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevsmsvcr80.dll Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvs /Y

    Copy Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevsreadme.htm Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvs /Y

    Copy Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevssetup.exe Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvs /Y

    Copy Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevssetup.ini Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvs /Y

    Copy Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevstoc.htm Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvs /Y

    Copy Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevsVSKnownIssues.htm Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvs /Y

    XCOPY Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevswcu64bitPrereq*.* Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvswcu64bitPrereq /E /H /R /Y

    XCOPY Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevswcuARM*.* Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_PackagesvswcuARM /E /H /R /Y

    XCOPY Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevswcuDExplore*.* Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_PackagesvswcuDExplore /E /H /R /Y

    XCOPY Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevswcudotNetFramework*.* Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_PackagesvswcudotNetFramework /E /H /R /Y

    XCOPY Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevswcuNetCF*.* Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_PackagesvswcuNetCF /E /H /R /Y

    XCOPY Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevswcuSDK*.* Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_PackagesvswcuSDK /E /H /R /Y

    XCOPY Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevswcuSQLCE*.* Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_PackagesvswcuSQLCE /E /H /R /Y

    XCOPY Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevswcuSSE*.* Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_PackagesvswcuSSE /E /H /R /Y

    Copy Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevswcurunmsi.exe Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvswcu /Y

    cls

    ECHO Creating the unattend.ini with MSDN included for the relevant CPU architecture

    IF %PROCESSOR_ARCHITECTURE%==x86 Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvssetupsetup.exe /createunattend Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_PackagesDatafilesvs2005unattended_onWin7x86.ini

    IF %PROCESSOR_ARCHITECTURE%==AMD64 Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvssetupsetup.exe /createunattend Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_PackagesDatafilesvs2005unattended_onWin7x64.ini

    ECHO GUI install choices For the unattend.ini…

    ECHO 1. Do not send data to Microsoft

    ECHO 2. Accept the Terms and Conditions

    ECHO 3. Name should be set as Rufus Leonard

    ECHO 4. Choose FULL Install and leave the default install directory

    Pause

    8. Download the x86 and 64-bit SQL 2005 Express Service Pack 2 installers from http://www.microsoft.com/…/details.aspx and overwrite the files in Z:AppsWinx86VisualStudioVisualStudio_2005ProVendorSourcevswcuSSE

    9. Once you’ve selected the install options for the unattended.ini and clicked finish, open the INI file (located in Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_PackagesDatafiles) in a text editor such as Notepad

    10. Locate the [PreInstallOrder] section and remove the following lines if present:

    gfn_mid framework

    gfn_mid framework ia64

    gfn_mid framework amd64

    gfn_mid windows installer 3.1

    11. Locate the [InstallOrder] section and remove the following lines if present:

    gfn_mid framework

    gfn_mid framework ia64

    gfn_mid framework amd64

    gfn_mid windows installer 3.1

    12. Locate the [PostInstallOrder] section and remove the following lines if present:

    gfn_mid framework

    gfn_mid framework ia64

    gfn_mid framework amd64

    gfn_mid windows installer 3.1

    13. Locate the [gfn_mid framework] section and change the line that says InstallActionInteger=5 to say InstallActionInteger=1

    14. Locate the [gfn_mid framework ia64] section and change the line that says InstallActionInteger=5 to say InstallActionInteger=1

    15. Locate the [gfn_mid framework amd64] section and change the line that says InstallActionInteger=5 to say InstallActionInteger=1

    16. Locate the [gfn_mid windows installer 3.1] section and change the line that says InstallActionInteger=5 to say InstallActionInteger=1

    17. Save and close the INI file

    18. Create a simple batch file with the following and runas as an administrator on the target machine

    REM Installing custom Visual Studio 2005 with slipstreamed SP1 and patches [CPU Arch Specific]

    Del %TEMP%*.* /Q

    Net use Z: \servershare

    REM Stop scanning agents which can interfere with the installation

    Net stop “AVScannerX”

    IF %PROCESSOR_ARCHITECTURE%==x86 GOTO x86

    IF %PROCESSOR_ARCHITECTURE%==AMD64 GOTO AMD64

    GOTO Exit

    :x86

    z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvssetupsetup.exe /unattendfile Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_PackagesDatafilesvs2005unattended_onWin7x86.ini

    GOTO Exit

    :AMD64

    z:AppsWinx86VisualStudioVisualStudio_2005ProRL_Packagesvssetupsetup.exe /unattendfile Z:AppsWinx86VisualStudioVisualStudio_2005ProRL_PackagesDatafilesvs2005unattended_onWin7x64.ini

    :Exit

    Net start “AVScannerX”

  12. RL says:

    Okay okay, I'm sad…

    The collect.exe cab file and a screen capture are now up on skydrive, I've shared them out to your ms a/c.

    Thanks!

    John

    23:00 UK. Home time already!

  13. Hi RL – I'm sorry for the delay getting back to you.  I've been out on vacation for a little while and haven't had time to look at this scenario until now.  The log file link you sent me is telling me that I don't have permissions to your SkyDrive share, so if you have a chance to take a look at that and fix it, I'd appreciate it.  I'd like to be able to look at the logs to see what setup is doing at the time that it stays running on your computer.

    It isn't necessary to create a transform and create an INI file.  Those are designed to be mutually exclusive deployment options.  Can you try eliminating the steps that create and use vs2005.mst and see if that makes any difference?

    Also, slipstreaming VS service packs isn't officially supported, so you may or may not run into issues if you try to do that.  Does your slipstreamed layout install correctly if you run in full UI mode instead of in unattended mode?  If you have time, could you try the same unattended scenario without any slipstreamed VS service packs and see if you get any better results?

  14. RL says:

    Hi Aaron,

    Just wondering if you got the logs I put on Skydrive?

    Thanks,

    RL

  15. Hi RL – I found the SkyDrive sharing notification email in one of my sub-folders – it got processed by a rule that I wasn't aware of.  When I tried to access the folder with your logs, it told me that it was only shared out to friends, so I sent you a friend request.  Let me know if the friend request shows up on your side.  Sorry for the hassles here.

  16. RL says:

    Hi Aaron,

    No invitation has arrived yet. So I invited you. Should arrive from Rufus …

    Failing this I'll set-up an FTP

    Thanks

    RL

  17. Hi RL – I'm sorry, but I haven't seen any invitations.  If you can make the folder with your log files public or setup an FTP, I'd appreciate it.

  18. RL says:

    Hi Aaron,

    Can we give Skydrive one last go. I can now see you listed as a friend…

    Thanks

  19. Hi RL – I don't have a link to your SkyDrive site anymore.  Can you please post a link so I can try again to download your log files?

  20. RL says:

    Hi Aaron,

    Thanks for all of this – I've resent the link.

    Kind regards,

    RL

  21. Hi RL – I've downloaded your logs, but I haven't had time to look at them yet.  I hope to have some time to look at them later this week, and I'll reply here when I do.

  22. RL says:

    Thanks Aaron,

    Fingers crossed – We've virtualised over 50 apps using App-V and created silent installers for the rest. This is the only app outstanding. Unfortunately our developers still use 2005 becauwse of client requirements.

    Anyhow, I'll leave in your capables.

    Thanks again,

    RL

  23. Hi RL – The logs in your vslogs.cab do appear to show a successful installation.  There is one particular log I was looking for that I didn't see in the cab though – dd_vsinstall80.txt.  That log is the one created by the VS setup engine, and I was hoping it would show more information about what it was doing so that I could try to narrow down why the setup process is not exiting in your scenario.  Can you check and see if you have that log file on one of your repro machines?

  24. RL says:

    Hi Aaron,

    I'll run another pass of it today and specifically look for that look and upload it if I find it.

    Thanks,

    RL

  25. RL says:

    Hi Aaron,

    I've uploaded 'dd_vsinstall80.txt' to skydrive.

    Thanks,

    RL

  26. RL says:

    Hi Aaron,

    Private link, just in case: skydrive.live.com/redir.aspx

    Thanks,

    RL

  27. Hi RL – Unfortunately, I don't see anything in this log that helps me narrow down the issue any further.  From what I can see, it is correctly skipping the .NET Framework and Windows Installer components, and it appears to have installed all components correctly (prerequisites, the main VS MSI, and post-requisites) prior to hanging.

    Would it be possible for you to try a simpler install scenario to see if that helps narrow down the issue any further?  For example, can you try creating the INI, removing the .NET Framework and Windows Installer components, and installing with this INI without doing any of the slip-streaming to see if that makes a difference?

    If that doesn't help either, you might need to chain the install of each of the components of VS setup and bypass the VS setup chainer entirely to avoid this issue.

  28. john.fry@rufusleonard.com says:

    Hi Aaron,

    I have found the same bug exists with unattended installations of Visual Studio 2008 Pro on Windows 7.

    * QUOTE: 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. END QUOTE. *

    We had to remove the following from the .ini files, as Windows 7 already comes with the version of .net framework (as per your other post: blogs.msdn.com/…/mailbag-what-version-of-the-net-framework-is-included-in-what-version-of-the-os.aspx):

    ‘gfn_mid net framework v3.5’ or ‘gfn_mid net framework v3.5 x64’

    I have another similar problem with an unattended installation of VS 2008…

    During the creation of the .ini file using the /createunattend switch we unselected the installation of SQL Express, however when we install VS2008 on a machine that has SQL full edition installed, the VS2008 unattended install fails with an error saying that there is a new version of SQL Server Compact 3.5 components already installed on the machine.

    Why is the VS2008 unattened install trying to even install the SQL Server Compact 3.5 components when SQL Express was clearly unselected during the /createunattend phase?

    Besides that question, do you know what line/s I need to remove in the .ini files to force the unattened installation to not attempt to install the SQL Server Compact 3.5 components?

    Thanks,

    John

  29. Hi RLJF – Correct, this same bug exists for both VS 2005 and VS 2008 setup, and you will need to disable the installation of the .NET Framework 3.5 on Windows 7 because the .NET Framework 3.5 SP1 ships with Windows 7 already, and trying to install the standalone version of the .NET Framework 3.5 will fail on Windows 7 as a result.

    SQL Express is a separate product from SQL Server Compact – the former is for PC database development and the latter is for compact device database development.  The checkbox in VS 2008 setup only causes SQL Express to be skipped.  The SQL Server Compact components are hidden and automatically selected for you when installing or creating an unattend file.

    I'm not sure how the new versions of the SQL Server Compact components got installed on your Windows 7 computer in the first place.  If you need to suppress installation of SQL Server Compact in your unattend file, you should be able to do so by removing the following entries from the unattend file:

    GFN_MID SQLEDesktopSDK

    GFN_MID SQLEToolsForVS2007

    GFN_MID SQLEDeviceSDK