Udostępnij za pośrednictwem


Application Deployment Prerequisites

To ensure that your application will install and run successfully, you must first ensure that all components upon which your application is dependent are already installed on the target computer. For example, most applications created by using Visual Studio have a dependency on the .NET Framework; the correct version of the common language runtime must be present on the destination computer before the application is installed.

You can select these prerequisites in the Prerequisites Dialog Box and install the .NET Framework and other redistributables as a part of your installation. This practice is known as bootstrapping. Next, Visual Studio generates a Windows executable program named Setup.exe, also known as a bootstrapper. The bootstrapper is responsible for installing these prerequisites before your application runs. For more information about selecting these prerequisites, see Prerequisites Dialog Box.

Each prerequisite is a bootstrapper package. A bootstrapper package is a group of directories and files that contain manifest files that describe how the prerequisite should be installed. If your application prerequisites are not listed in the Prerequisite Dialog Box, you can create custom bootstrapper packages and add them to Visual Studio. Then you can select the prerequisites in the Prerequisites Dialog Box. For more information, see Creating Bootstrapper Packages.

By default, bootstrapping is enabled for both Windows Installer deployment (by using Setup projects in Visual Studio) and ClickOnce deployment. The bootstrapper generated for Windows Installer deployment is not signed, but in ClickOnce deployment, the bootstrapper is signed. You can disable bootstrapping for a component, but you should do so only if you are sure that the correct version of the component is already installed on all target computers.

Bootstrapping and Windows Installer Deployment

If you use Setup projects in Visual Studio to deploy your application, the default launch condition is the .NET Framework 4 Client Profile and the default selected bootstrapper package is the .NET Framework 4 Client Profile and Windows Installer 3.1. If your application targets a different version of the .NET Framework, you must update the prerequisite components in the Prerequisites Dialog Box. For more information, see How to: Install Prerequisites in Windows Installer Deployment.

If you generate the bootstrapper by using a Setup project in Visual Studio, the Setup.exe is not signed. However, you can use SignTool.exe to sign it. For more information, see How to: Sign Setup Files with SignTool.exe (Windows Installer).

Bootstrapping and ClickOnce Deployment

Before installing an application on a client computer, ClickOnce will examine the client to ensure that it has certain requirements specified in the application manifest. These include the following:

  • The minimum required version of the common language runtime, which is specified as an assembly dependency in the application manifest.

  • The minimum required version of the Windows operating system required by the application, as specified in the application manifest using the <osVersionInfo> element. (See <dependency> Element (ClickOnce Application))

  • The minimum version of any and all assemblies that must be preinstalled in the global assembly cache (GAC), as specified by assembly dependency declarations in the assembly manifest.

ClickOnce can detect missing prerequisites, and you can install prerequisites by using a bootstrapper. For more information, see How to: Install Prerequisites with a ClickOnce Application.

Note

To change the values in the manifests generated by tools such as Visual Studio and MageUI.exe, you need to edit the application manifest in a text editor, and then re-sign both the application and deployment manifests. For more information, see How to: Re-sign Application and Deployment Manifests.

If you use Visual Studio and ClickOnce to deploy your application, the bootstrapper packages that are selected by default depend on the version of the .NET Framework in the solution. However, if you change the target .NET Framework version, you must update the options in the Prerequisites Dialog Box manually.

Target .NET Framework

Selected Bootstrapper Packages

.NET Framework 4 Client Profile

.NET Framework 4 Client Profile

Windows Installer 3.1

.NET Framework 4

.NET Framework 4

Windows Installer 3.1

With ClickOnce deployment, the Publish.htm page generated by the ClickOnce Publish Wizard points either to a link that installs only the application or to a link that installs both the application and the bootstrapped components.

If you generate the bootstrapper by using the ClickOnce Publish Wizard or the Publish Page in Visual Studio, the Setup.exe is automatically signed. However, if you want to use your customer's certificate to sign the bootstrapper, you can sign the file later. For more information, see How to: Sign Setup Files with SignTool.exe (Windows Installer).

Bootstrapping and MSBuild

If you do not use Visual Studio, but compile your applications on the command line, you can create the ClickOnce bootstrapping application by using a Microsoft Build Engine (MSBuild) task. For more information, see GenerateBootstrapper Task.

As an alternative to bootstrapping, you can pre-deploy components using an electronic software distribution system, such as Microsoft Systems Management Server (SMS).

Bootstrapper (Setup.exe) Command Line Arguments

The Setup.exe generated by Visual Studio and the MSBuild tasks supports the following small set of command-line arguments. Any arguments supplied to the bootstrapping application beyond these are forwarded to the application installer.

If you change any bootstrapper options, you must change the unsigned bootstrapper and then sign the bootstrapper file later. For more information, see How to: Sign Setup Files with SignTool.exe (Windows Installer) or How to: Sign Setup Files with SignTool.exe (ClickOnce).

Command Line Argument

Description

-?, -h, -help

Displays a Help dialog box.

-url, -componentsurl

Shows the stored URL and components url for this set up.

-url=location

Sets the URL where Setup.exe will look for the ClickOnce application.

-componentsurl=location

Sets the URL where Setup.exe will look for the dependencies, such as the .NET Framework.

-homesite=true|false

When true, downloads the dependencies from the preferred location on the vendor's site. This overrides the -componentsurl setting. When false, downloads the dependencies from the URL specified by -componentsurl.

Operating System Support

The Visual Studio bootstrapper is not supported on Windows Server 2008 Server Core or Windows Server 2008 R2 Server Core, which provide a low-maintenance server environment with limited functionality. For example, the Server Core installation option only supports the .NET Framework 3.5 Server Core profile, so Visual Studio features that depend on the full .NET Framework cannot run.

See Also

Concepts

Choosing a ClickOnce Deployment Strategy

ClickOnce Security and Deployment