Delen via


How to: Create and Run an Unattended Installation of Visual Studio

You can run the installation application for Visual Studio as an unattended (that is, customized silent) installation over an intranet instead of from media such as DVDs. This topic shows how to prepare Visual Studio for this type of installation from a network share.

Creating a Network Image

First, create a network image of the Visual Studio media.

To create a network image

  1. Create a folder on the server (for example, Drive:\IDEinstall\).

  2. Perform one of the following steps:

    • Download the web bootstrapper, and then run Product.exe /Layout Drive:\IDEinstall\.

      OR

    • Copy the contents of the media for Visual Studio to the IDEinstall folder.

  3. Share the IDEinstall folder on the network, and set the appropriate security settings.

    The network path of the installation application for Visual Studio resembles \\ServerName\IDEinstall\Product.exe.

    Note

    Installation may fail if any path and file name combination exceeds 260 characters. The maximum length of a path in Visual Studio is 221 characters.  The local path name should not exceed 70 characters, and the network path name should not exceed 39 characters.

    Installation may also fail if the folder names in the path include embedded spaces (for example, "\\ServerName\IDEinstall" or \\ServerName\Visual Studio\).

Deploying Visual Studio in unattended mode

To deploy Visual Studio in unattended mode, you must modify the AdminDeployment.xml file, which is in the root directory of the installation media. You can use this file to either push a deployment of Visual Studio to your network or pulled into an installation if you put that file in the Drive:\IDEinstall\packages directory. The AdminDeployment.xml file is not unique to an operating system, architecture, edition of Visual Studio, or operating-system language.

Note

During installation, the computer may automatically restart one or more times. After it restarts, you must log back in with the same user account with which you were logged on before the computer restarted. You can avoid automatic restarts by installing the prerequisite components before you run a unattended installation. For more information, see the section entitled "Avoid Restart During Setup" in the Visual Studio Administrator Guide.

The AdminDeployment file schema contains the following elements:

Element

Attribute

Values

Description

BundleCustomizations

TargetDir

Path

Behaves the same as overriding the path in the user interface of the installation application. This element is ignored if Visual Studio is already installed.

BundleCustomizations

NoWeb

yes|default

If the value of this element is yes, the installation application never attempts to go to the web during the setup action.

SelectableItemCustomization

Hidden

Yes|No

If the value of this element is Yes, hides a Selectable item in the customization tree.

SelectableItemCustomization

Selected

Yes|No

Selects or clears a selectable item in the customization tree.

Warning

The installation application will respect the Selected state of a SelectableItem even if it is hidden. For example, if you want to always install a selectable item, you can mark it as hidden and selected.

To create an unattended installation of Visual Studio

  1. In Drive:\IDEinstall\AdminDeployment.xml file, change the value of the NoWeb attribute of the BundleCustomizations element from "default" to "yes" as the following example shows:

    Change <BundleCustomizations TargetDir="default" NoWeb="default"/> to <BundleCustomizations TargetDir="default" NoWeb="yes"/>

  2. Change the SelectableItemCustomization attribute as needed for optional components, and then save the file.

Running Unattended Setup

You can run unattended setup either by automatically running the installation application for Visual Studio on client computers or by allowing users to run the application themselves using settings that you define.

To run an unattended installation on a client computer

  • Open the Start menu, choose Run, and then enter \\ServerName\IDEinstall\vs_Product.exe /adminfile PathOfTheAdmindeployment.xmlFileAdditionalParametersAsNeeded

    For example, you can specify the following command line: \\server1\IDEinstall\vs_ultimate.exe /adminfile \\server1\ IDEinstall\AdminDeployment.xml /quiet /norestart

To enable clients to manually install Visual Studio with pre-defined settings

  1. Copy the customized AdminDeployment.xml file to a network share that is read-only (for example, \\ServerName\IDEinstall\packages\AdminDeployment.xml).

  2. Enable users to install from that share.

Maintaining an Installation

If you open Control Panel and rerun the installation application, you can modify features of Visual Studio, uninstall programming languages, and repair or uninstall Visual Studio.

Note

You must have administrative credentials on the local computer to use maintenance mode.

To maintain an installation on a client computer

  • Open Control Panel, and then choose Programs and Features.

  • Choose Visual Studio, and then choose Change.

To change AdminDeployment settings on a client computer after Visual Studio has been installed

  1. Update admindeployment.xml as needed.

  2. Open the Start menu, and then choose Run.

  3. Enter the following text:

    \\ServerName\IDEinstall\vs_Product.exe /AdminFile PathToAdmindeployment.xmlFile AdditionalParametersAsNeeded

    For example, you can specify the following command line: \\server1\IDEinstall\vs_ultimate.exe /adminfile \\server1\IDEinstall\AdminDeployment.xml /quiet /norestart

Repair is the default parameter after Visual Studio is installed. If you repair Visual Studio with an updated /AdminFile, you will override the current Admin Deployment Settings with those that the updated AdminDeployment.xml invokes.

Register the product

After installation is complete, you can register your copy of Visual Studio from within Visual Studio.

To register

  1. Open the Help menu, and then choose Register Product.

  2. Enter product key.

See Also

Other Resources

Installing Visual Studio