Aaron Stebner's WebLog

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

Instructions for chaining installation of Visual Studio 2005 and MSDN

Instructions for chaining installation of Visual Studio 2005 and MSDN

  • Comments 44

I got a question from a customer who found this blog post describing how to chain silent installation of VS .NET 2003 prerequisites, VS .NET 2003 and MSDN.  They wanted to know what the equivalent set of steps would be for chaining silent installation of VS 2005.  There have been some modifications to how setup works behind the scenes in VS 2005, most notably the elimination of the separate step that used to be required to install prerequisite components for VS, so happily I can say these steps are much simpler than in the past.  Here are the steps for VS 2005 (using the same format as my previous post).

To start with you should stage Visual Studio bits to a network share so that you can use this as your installation source later on.  You can accomplish that with the following steps (also described in the VS readme located in the file adminreadme.htm in the Setup subdirectory on VS Disk 1):

  1. Create a folder on your server, such as \\server\vs2005
  2. Create subfolders named \\server\vs2005\vs and \\server\vs2005\msdn
  3. Copy the contents of all CDs labeled Visual Studio 2005 to \\server\vs2005\vs.  If prompted, choose yes to overwrite existing files.
  4. Copy the contents from all the CDs labeled MSDN Library for Visual Studio 2005 to \\server\vs2005\msdn.  If prompted, choose yes to overwrite existing files.
    NOTE: You can substitute a different MSDN Quarterly Library for the version of MSDN that shipped with Visual Studio 2005 if you choose

Now that you have a network image, you can create the unattended INI file to install VS 2005 and MSDN using the following steps:

  1. Locate a test computer that has the same operating system that you want to deploy Visual Studio to in your network, and make sure that it does not already have Visual Studio 2005 installed
  2. Install .NET Framework 2.0 on your test computer (because this is required for creating an unattend file for Visual Studio in the next step)
  3. Run \\server\vs2005\vs\setup\setup.exe /createunattend \\server\vs2005\datafiles\vs.ini /vsupdate=\\server\vs2005\MSDN\setup.exe /vsupdateargs="qn"
  4. Open \\server\vs2005\datafiles\vs.ini, go to the [PostSetupLaunchList] section and change """qn""" to /qn
  5. Go to a clean computer without Visual Studio 2005 installed and run \\server\vs2005\vs\setup\setup.exe /unattendfile \\server\vs2005\datafiles\vs.ini to test the unattended installation process

There are a couple of gotchas that I have seen that you should keep an eye out for when following these instructions:

  • Make sure to note the extra \setup\ directory for the Visual Studio setup.exe in the steps above.  Unattended installation will not work correctly if you run the setup.exe in the root of the \\server\vs2005\vs folder; you must use \\server\vs2005\vs\setup\setup.exe.
  • Make sure that you have write permission for the location that you create your data file at in step 3 (in this example I used \\server\vs2005\datafiles).  You will get an error if you try to create the data files on a share that you do not have write permissions for.
  • Make sure that you create the INI file on a computer that does NOT already have Visual Studio 2005 installed.  If you have VS installed, you will end up creating an INI file for a maintenance mode update instead of an initial install of VS.
  • The INI file for VS is unique to each version of VS (such as Pro, Standard, Team System), and also unique to the OS that you want to install on (Windows 2000, Windows XP, etc).  Make sure that you create INI files on computers that match what you will eventually be deploying to.

There is an advanced trick that you can use when creating this unattend script as well:

  • If you want to perform a full install of MSDN to the local hard drive instead of a default installation, you can read the steps at this blog post to learn how to update your vs.ini file to call MSDN setup with the correct parameters to accomplish this.

In the VS 2003 instructions there was an additional advanced trick regarding waiting for the setup process to exit and checking the return code.  The workaround I listed in my previous post is not necessary in VS 2005 because setup now has specific logic to not copy itself to the %tmep% folder and start a new process if it detects it is being run in administrative installation mode.


  • Visual Studio Team System

    Yesterday marked the one-year anniversary of the public announcement of...
  • I have been trying today to get the unattended install for MSDN library working after a successful unattended install of VS 2005 Beta 2. I have tried the following commands on the command line in the MSDN folder on the local drive:

    setup.exe /qn
    setup.exe ADDLOCAL=ALL /qn
    setup.exe "ADDLOCAL=ALL" /qn
    setup.exe TARGETDIR=E:\MSDN /qn
    setup.exe "TARGETDIR=E:\MSDN" /qn

    I have also tried replacing the /qn with /passive so that I have a visual response. The behavior is that msiexec loads for about 3 seconds before it unloads without performing the installation.

    Any ideas what is happening?

  • As you can tell, I am new at this. I performed the above task again with logging on and discovered the cause of my problems.

    It turns out that the MSDN setup program thinks that a component is already installed, and therefore, it will not let me modify the path. This results in an error indicating that there is not enough disk space on C:\ (which there isn't).

    To contribute to this line of thinking, when I first pulled up the help syntax (setup /?), I was prompted to install something before it would display it, and I selected yes. Maybe this is why it thinks it's been installed?

    However, when I start setup and go through the GUI installer, the prompts are all for a new installation, and I am able to change the install path and successfully install.

    I'm trying again on a fresh system to see if this problem goes away there. But if you have any suggestions, I'm happy to read them.

    Thanks again.
  • Hi Jonathan -

    It looks like something weird is going on with the MSDN setup.exe and the command line switches it supports. I'm going to try to repro this on my test machine and see if I can figure it out. In the meantime, you should be able to do an unattended MSDN install by using the following command line:

    msiexec.exe /qb /i msdn.msi

    I'll post an update with what I figure out about the setup.exe switches....
  • Hi again Jonathan - I didn't see your 2nd comment when I posted my 1st reply. I will still investigate the setup.exe issue because I'm seeing the same behavior when I run setup.exe /? (and that seems like a bug to me, /? should show usage and not make you install something first...maybe you can post it on http://lab.msdn.microsoft.com/productfeedback/ if you have a chance? I'll also tell the MSDN team)

    Regarding your other question about the path being forced to C:\ - this is by design. MSDN shares some components with Visual Studio, so if VS is already installed to the C drive then MSDN will require you to install to the same location. If that location is short on disk space that makes this scenario pretty bad unfortunately :-(

  • Aaron,

    Thanks for your replies. I will post the MSDN issue on the product feedback site.

    Regarding MSDN forcing to C:\, Visual Studio was installed to drive E:\ - with the exception of the components that are forced to C:\, such as msbuild, sourcesafe, primary interop assemblies, and a handful of other things.

    I am working on a fresh virtual PC image today with rollback capabilities, so I should be able to get through multiple attempts and hopefully a successful install.
  • Hi Jonathan -

    Unfortunately, it isn't necessarily as easy as choosing to install VS to a drive other than C. There are some components that VS installs to <system_drive>\Program Files\Common Files\ even if you choose to move the main VS install location to another drive. I believe this is what will end up causing MSDN to not allow you to change the path during setup. One option you could try on that machine is to run MSDN from source so it won't require so much disk space.

    I wrote a blog articlea while back that kind of explains what is happening behind the scenes that causes the installation path to not be changeable if you're interested in reading more. You can find it at - http://blogs.msdn.com/astebner/archive/2004/12/01/273453.aspx

    Also, I tried a couple of VS 2005 beta 2 install scenarios last night and running the MSDN setup.exe /qn worked fine for me (assuming I had enough disk space on C).
  • Aaron,

    I understand that not everything in the VS 2005 and MSDN packages will get installed on the secondary drive.

    However, what I am trying to get around is the difference of 1.78 GB of data that gets installed into the specified target directory during an MSDN installation.

    When I execute the command:

    e:\installations\vsts2005\msdn\setup.exe TARGETDIR="E:\Program Files\MSDN" ADDLOCAL=ALL /qn /log E:\Installations\VSTS2005\Unattended\msdn.log

    the installation completes, but everything is still installed on C:\ (with 1.78 GB of files in the default target path of C:\Program Files\MSDN). An odd occurrence is that the E:\Program Files\MSDN folder also gets created, but no files get installed there. I see in the log file where the package collects the TARGETDIR from the command line, but it does not use it.

    On the contrary, when I install through the GUI and modify the path through the form, the 1.78 GB of files is installed to E:\Program Files\MSDN), while the components that must be installed to C:\ are still placed there (according to the docs, about 1 GB of space). This is the installation result that I am hoping for with an unattended install.

    So my inclination is to try and find why setup behaves differently between an unattended install versus a GUI install with regard to the target directory.
  • Hi Jonathan -

    If possible, could you zip and send me the MSI verbose log files from each of those installations (the unattended one and the UI mode one)? There is likely some difference in the command line switches that is causing the non-default unattended install to behave incorrectly, and the log file should let us figure this out. You can email me at aaronste (at) microsoft (dot) com.

  • I got a question from a customer who is trying to use the instructions in this blog post to perform a...
  • It works great for me.
    As you said, the setup created on Windows 2000 doesn't work on Windows XP, but when I create a setup from XP, it works on Windows 2000 too ! :)
  • Is there anyway to use QB? I tried doing a QB and it didn't work. I want to give users a progress bar at least.

  • What if the target computers have VS2003 already installed ? Do I have to make a separate .ini for them ?
  • Hi Aaron,

    I have a question about the unattended installation of Visual Studio 2005. How will this work if VS 2003 is installed on the pc already? Does this work like an upgrade or does it wipe VS 2003 out completely and install a fresh copy of VS 2005. I am looking to install this to 30 computers and need to know it's behavior before I proceed.
  • Hi Mike - VS 2005 is designed to work correctly in side-by-side scenarios with VS6, VS .NET 2002 and/or VS .NET 2003 already installed on the system. You will be able to use the unattended installation instructions listed above even if your systems have VS .NET 2003 installed. Please contact me using http://blogs.msdn.com/astebner/contact.aspx if you run into any trouble getting this to work in your scenario.
Page 1 of 3 (44 items) 123
Leave a Comment
  • Please add 8 and 4 and type the answer here:
  • Post