ClickOnce Sample

To get samples and instructions for installing them, see the following:

  • Click Samples on the Visual Studio Help menu.

    For more information, see Locating Sample Files.

  • The most recent versions and the complete list of samples are available on the Visual Studio 2008 Samples Web site.

  • You can also locate samples on your computer's hard disk. By default, samples and a Readme file are copied to a folder under \Program Files\Visual Studio 9\Samples\. For Visual Studio Express Editions, all samples are located on the Internet.

To build and publish this solution

  1. Build the solution: Right-click the project name in Solution Explorer and then click Build.

  2. Publish the solution: Right-click the project name in Solution Explorer and then click Publish. For more information about the Publish Wizard, see How to: Publish a ClickOnce Application.

Demonstrates

The ClickOnce feature can be used to programmatically handle several installation and maintenance tasks. This includes the following:

  • Checking for updates   Uses the CheckForUpdate method to check for new updates.

  • Updating an application   Uses the UpdateAsync method to download the updated application.

  • Downloading optional files   Uses the DownloadFileGroupAsync method to download files.

  • Deployment information   The My.Application.Deployment property is used to retrieve and report the name, version, location, and last update check.