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

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.