Compartilhar via


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 destination 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.

Platform Detection for ClickOnce

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 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 Reference))

  • 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, but cannot install them. If any of these platform dependencies are found to be missing, ClickOnce halts installation and presents an error dialog box to the user.

NoteNote

There is no tool support for setting specific versions of the .NET Framework and the operating system within the manifest. To change the default values 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.

Bootstrapping for ClickOnce Applications

Missing prerequisites must be installed using separate redistributable packages. The deployment tools in Visual Studio let you install the .NET Framework and other redistributables as a part of your installation—a practice known as bootstrapping.

Visual Studio includes the following deployable packages:

  • Microsoft .NET Framework version 2.0

  • Microsoft Data Access Components (MDAC) 2.8

  • Microsoft Visual J# .NET Framework Redistributable Package 3.1

  • SQL Server 2005 Express Edition

  • Windows Installer 2.0

By default, bootstrapping is enabled for both Windows Installer deployment and deployment with ClickOnce. You can disable bootstrapping for a component, but you should only do so if you are sure that the correct version of the component is already installed on all target computers.

When you deploy a ClickOnce application by using Visual Studio, the development environment will prompt you if you want to include certain redistributables, such as the .NET Framework, as dependencies. If you select one or more of these options, Visual Studio will generate a Windows executable program named Setup.exe (the "bootstrapper") that is responsible for installing these dependencies before your application runs. This bootstrapper runs as a separate process that is independent of the ClickOnce run-time engine.

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 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. This is the same build task that Visual Studio uses to generate the bootstrapping application. For more information, see GenerateBootstrapper Task. For more information about how to use MSBuild to compile projects, see MSBuild Overview.

During installation, users on certain Windows operating systems may be prompted for administrative permissions to run the redistributables, even if they are already installed.

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

Bootstrapping Application (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.

  • -?
    Displays a Help dialog box.
  • -url
    Shows the stored URL and -componentsurl 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.

See Also

Concepts

Choosing a ClickOnce Deployment Strategy
ClickOnce Deployment Overview
MSBuild Overview