Deployment in Visual Studio
How to: Install Prerequisites with a ClickOnce Application

All ClickOnce applications require that the correct version of the .NET Framework is installed on a computer before they can be run; many applications have other prerequisites as well. When publishing a ClickOnce application, you can choose a set of prerequisite components to be packaged along with your application. At installation time, a check will be performed for each prerequisite to determine if it already exists; if not it will be installed prior to installing the ClickOnce application.

Instead of packaging and publishing prerequisites, you can also specify a download location for the components. For example, rather than including prerequisites with every application that you publish, you might use a centralized file share or Web location that contains the installers for all of your prerequisites—at install time, the components will be downloaded and installed from that location.

Prerequisites are managed in the Prerequisites dialog box, accessible from the Publish pane of the Project Designer.

NoteNote:

In addition to the predetermined list of prerequisites, you can add your own components to the list. For more information, see Adding Custom Prerequisites.

To specify prerequisites to install with a ClickOnce application

  1. With a project selected in Solution Explorer, on the Project menu click Properties.

  2. Select the Publish pane.

  3. Click the Prerequisites button to open the Prerequisites dialog box.

  4. In the Prerequisites dialog box, make sure that the Create setup program to install prerequisite components check box is selected.

  5. In the Prerequisites list, check the components that you wish to install, and then click OK.

    The selected components will be packaged and published along with your application.

To specify a different download location for prerequisites

  1. With a project selected in Solution Explorer, on the Project menu click Properties.

  2. Select the Publish pane.

  3. Click the Prerequisites button to open the Prerequisites dialog box.

  4. In the Prerequisites dialog box, make sure that the Create setup program to install prerequisite components check box is selected.

  5. In the Specify the install location for prerequisites section, select Download prerequisites from the following location.

  6. Select a location from the drop-down list, or enter a URL, file path, or FTP location, and then click OK.

    NoteNote:

    You must make sure that installers for the specified components exist at the specified location.

See Also

Tasks

Concepts

Other Resources

Tags :


Community Content

Daniel Smith
Limitations

One incredibly important detail to note about the prerequisites (and should really be mentioned in the article) is that ClickOnce cannot handle any changes to your prerequisites after your application has been installed.

So if you deploy your application, then make changes to the prerequisites and re-publish a new build, depending on the changes, all your existing installations may very well fail due to out of date or missing components.

Tags :

jenlouie
Updating the publish location URL in the bootstrapper (setup.exe)
The prerequisite bootstrapper (setup.exe) has a number of arguments that allow you to update it without having to regenerate the entire deployment package.

If you are planning on moving your ClickOnce package to a new server, this is important to note. If you're updating the -url, -componentsurl, or -homesite tags, you'll need to use the undocumented -dest flag.

-? : Show usage dialog.
-url or -componentsurl : Show the stored URL and components URL for this setup.
-url=<location> : Sets the URL source to the specified location.
-componentsurl=<location> : Sets the location to download prerequisites from. If it's blank, the prerequisites are downloaded from where the application is located or the homesite (if set).
-homesite=<true or false> : When set to true, downloads the components from their vendors' website, orverrides the components URL.
-dest=<name of new setup exe> : This is an undocumented flag. Use this when a new setup bootstrapper needs to be created with an updated URL, components URL, or homesite. You would do this by: 1) Copy setup.exe to foo.exe. 2) Run foo.exe to modify the original setup.exe: foo.exe /url=http://test/me /dest=setup.exe 3) Delete foo.exe.

Tags :

Page view tracker