Aaron Stebner's WebLog

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

How to perform an unattended install of Visual Studio 2005 from a DVD-ROM drive

How to perform an unattended install of Visual Studio 2005 from a DVD-ROM drive

  • Comments 15

I recently heard from a customer who was trying to deploy Visual Studio 2005 using an unattended INI file and saw setup fail, but only when launching setup directly from the DVD.  If they shared the DVD-ROM drive and installed from it using a UNC path or a mapped drive letter, it worked fine.

I took a look at the setup source code and found that due to a really old bug back in the Visual Studio .NET 2002 timeframe, we disabled launching unattended installation directly from removable media.  However, there have been some changes in setup since then that make it possible for an unattended installation to succeed in this scenario.  Namely, we started shipping Visual Studio on a single DVD instead of multiple CDs, so no disk swaps are necessary.

In order to perform an unattended installation of Visual Studio from a DVD-ROM install location, you will have to take advantage of an undocumented command line switch that exists in setup.exe.  Here are the steps that will allow you to do this:

  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. Launch Visual Studio 2005 in unattended INI creation mode by running <Visual Studio source location>\setup\setup.exe /createunattend <path to INI file to create>
  4. Step through the Visual Studio 2005 setup UI and create an unattended uninstall INI file
  5. Launch Visual Studio 2005 setup in unattended uninstall mode by running <Visual Studio source location>\setup\setup.exe /unattendfile <path to INI file created step 2 above> /PromptForCD

The /PromptForCD switch in step 5 will cause setup to skip the check to see if setup is running from a DVD-ROM drive.  If you are attempting to perform an unattended install from CD instead of DVD, this switch will also cause a dialog to appear when you need to swap discs, which will make installation not be silent anymore.  However, there is no way to perform a fully silent installation from CD anyways because you have to know to swap the discs in the middle of setup.  This switch will not have any effect for a DVD install because no disc swaps are required for that scenario.

 

  • Launch Visual Studio 2005 in unattended INI creation mode by running <Visual Studio source location>\setup\setup.exe /createunattend <path to INI file to create>

    Am stucked on this path.. kindly help me out..
    "c:\\Microsoft\NET\Setup /createunattend c:\"

    this what i have mentioned in run command. Please correct me if am wrong
  • "c:\\Microsoft\NET\Setup /createunattend c:\test.ini"

    setup runs but doest create any ini file under c:\
  • Hi Rootstat and nVidia - You have to provide a file name and not just a drive letter for the unattend file.  You also need to make sure you run the setup.exe in the Setup subdirectory and not hte one at the root of the Visual Studio installation directory.  The command line should look like the following:

    c:\Microsoft\NET\Setup\Setup.exe /createunattend c:\test.ini

    Can you try that out and see if it works for you?
  • Hi Astebner,
    Am able to creae the test.ini as well able to run on network client machine. now the problem is it reboots in between. and if i run the command again same happens again.
  • Can you guide me how to stop the auto reboot it happens 2 to 3 times during installtion. I dont mind once after it completely installs.
  • Astebner Now the only thing is i am able to install on to network client machine. But it reboots in between i want to continue the full installation without reboot in between. it dont mind auto reboot at the end of full setup.
    please let me know the solution for it.. thanks in advance.
  • Hi nVidia - I have posted an article at http://blogs.msdn.com/astebner/archive/2006/03/17/554248.aspx that describes how to manage reboots during unattended installs of Visual Studio 2005.  Hopefully this will help you here.

    Also, I have posted several other items related to unattended installs at http://blogs.msdn.com/astebner/articles/574618.aspx that may be useful to you as well.
  • Hey, have you had it come up asking to insert the DVD?
    I'm trying to run it from an unattended xp install I'm making but it's being a little irritating in getting to run properly.
    Any help you can give would be much appriciated.
  • Hi Damien - I'm not sure I understand your scenario.  Are you trying to preinstall Visual Studio as part of Windows XP setup?  Can you list the exact command lines that you are using to try to install it and also how you are launching setup during XP setup?  Finally, are you copying the Visual Studio installation files to the local hard drive, installing from the network or installing from a DVD?
  • Hi,sorry I should have described in more detail.
    I am using a post windows install program that adds the commands to runoncex when you first login after installing windows.
    Since this didn't work the first time I've been fiddling running commands and got as far as installing all the prequisites silently, and then running d:\WPI\Install\studio\vs\setup\setup.exe /unattendfile c:\unattended.ini /PromptForCD.
    This installs sql server 2005 express, not sure how much further, but then I get a window asking for me to insert the Visual Studio 2005 DVD.

    All the files are stored on the dvd (copying across that much data didn't really appeal).

    I hope you'll be able to point me in the right direction.
    Thanks.
  • Hi Damien - The commands at the top of this blog post should allow you to perform an unattended install of both the prerequisites and Visual Studio (including SQL Express).  What is the exact command line that you have been putting in the RunOnceEx registry value to initiate the installation of Visual Studio?  Also, can you look at %temp%\dd_vsinstall80.txt and see if there is any information in there about why installation is not working correctly?  If you can send me that log file at Aaron.Stebner (at) microsoft (dot) com, I will try to take a look and see if I can figure anything out...
  • Question:
    I am trying to create an integrated installation DVD that includes Visual Studio 2005 as well...
  • PingBack from http://blogs.msdn.com/astebner/articles/574618.aspx
  • This guide is intended to serve as a collection of links to articles, tools, tips and tricks that explain

  • During the rebuild of my development environment I wanted to use the same trick I used before to reduce...

Page 1 of 1 (15 items)
Leave a Comment
  • Please add 5 and 6 and type the answer here:
  • Post