Visual Studio 2002, 2003 and 2005 setups include a silent deployment mode that requires multiple steps (creating an INI file on the matching OS version and language, then running VS setup and passing it the INI file to perform the installation). Those of you who have automated the installation of these versions of Visual Studio can attest to the difficulties that this multi-step, OS version-specific process has introduced.
In order to make the most commonly needed automated installation scenarios easier to achieve, the following command line switches have been added to Visual Studio 2008 setup:
- setup.exe /q - this will perform a silent default installation of VS 2008. This is the equivalent of running VS 2008 setup using setup UI and selecting the Default install type radio button.
- setup.exe /q /full - this will perform a silent full installation of VS 2008. This is the equivalent of running VS 2008 setup using setup UI and selecting the Full install type radio button.
Note - if you need to pass in a product key when running setup using these new silent switches, you will need to use the syntax described in this blog post.
There are some important notes to keep in mind for these new silent install options:
- When using these command line switches, you must make sure that you pass them to the setup.exe in the Setup subdirectory, and not to the setup.exe at the root of the VS 2008 installation disc. Only the setup.exe in the Setup subdirectory understands these command line parameters.
- If you run setup.exe /q on a system that already has that edition of VS 2008 installed, it will invoke a silent repair instead of a silent installation.
- If you need to perform a silent non-default installation of VS 2008 (as opposed to a default or a full installation), then your best bet will be to use the INI creation mode that has existed in previous versions of VS 2008.
- It is also possible to gather a list of feature names that you want to install by running VS 2008 setup once in UI mode, selecting the features you want to install in the setup UI feature tree, then looking at the verbose MSI log file that is created during installation to figure out the exact list of feature names to pass in during silent installation. However, that option is more complicated and error-prone than INI creation mode, so I don't recommend using this method unless absolutely necessary.
- If you want to be able to control reboots, you can also pass in the /norestart switch. This will prevent setup from forcing a reboot during installation if one of the components it is installing requests one. It does not, however, postpone the reboot until the end of setup. In some cases, the setup team determined that it is not safe to defer reboot requests for a component, and have set a flag in a setup data file to indicate that (specifically, the flag RebootLaterOk=0 in baseline.dat). If one of these components returns 3010, and you pass in the /norestart switch, then setup will exit but will not reboot. It is up to the process running the silent install to reboot the system and re-start setup after the reboot in order to allow setup to continue.
- To avoid reboots, you can configure your systems with any prerequisite packages that tend to cause reboot requests prior to deploying VS 2008. Doing this will cause VS 2008 setup to skip installing those prerequisites because setup will detect that they are already present on the system.
<update date="9/20/2007"> Added more details about how the /norestart switch works </update>
<update date="12/17/2008"> Added a link to a separate blog post I wrote about how to pass a product key into setup when using the /q switch. </update>