Deploying Smart Client Applications with ClickOnce
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies.
ClickOnce is a smart client deployment mechanism that is part of the .NET Framework 2.0 and later versions. ClickOnce enables automatic deployment and update of smart client applications over the network from a deployment server. Using ClickOnce, you can take advantage of the capabilities of smart client applications and have the ease of maintenance and update of server-based applications. To deploy or update a ClickOnce deployed application, you only need to publish your application to a deployment server and provide a link to the application to your users. When a user launches the application through the link, the application is automatically deployed and cached on the client computer; then it launches and runs from there.
ClickOnce supports many options, including the following:
- HTTP, UNC, or CD/DVD can be used for deployment.
- A URL or the Start menu can be used to launch the application.
- The application can be used online-only or online and offline.
- Updates can be checked for and applied at times you designate.
- Updates can be obtained from the location you specify.
- Updates can be mandatory or optional.
- A programmatic API can be used to explicitly control the update process.
ClickOnce supports two deployment modes: installed and online-only. The installed mode (available offline and online) supports the use of the application on the client computer even if the client computer is offline with respect to the deployment server. Installed applications allow the user to launch the application with a Start menu shortcut created when the application is first deployed to the client computer. Online-only applications must be launched through a URL to the deployment manifest on the server every time they are used; therefore, the client computer must be able to connect to the deployment server to run the application. The ability to operate offline with respect to the deployment server is unrelated to the application's ability or inability to operate offline with respect to the back-end services the application is designed to communicate with for normal operations. Other forms of connectivity checking will need to be used to determine whether the application can communicate with its back-end services after application launch.
ClickOnce supports both automatic updates and programmatic updates. The automatic updates are done by the ClickOnce runtime on the client computer before or after the application starts, and a number of options are supported. Programmatic updates are done through the ApplicationDeployment class in the System.Deployment.Application namespace. For more information, see How to: Add On-Demand Programmatic Update.
The options for automatic updates include the following:
- Checking for updates before the application starts, after the application starts, or both
- Making an update optional or required
- Checking for updates on a scheduled basis
- Checking for updates in a location different from the original installation
ClickOnce automatic updating downloads an update as soon as it is available on the server and applies the update the next time the application runs. As a result, if you want to delay the application of an update after it is on an update server, you will have do one of two things:
- Use the ClickOnce programmatic API to detect when the update is available, and delay programmatically downloading the update until your delay criteria is met (possibly by checking a remote service that tells the application when to update).
- Use a dynamic loading mechanism, such as the Composite UI Application Block profile catalog, to determine when to load and start using a file. ClickOnce can immediately download updates when they are available, but the profile catalog determines when those updates are applied. For more information, see How to: Apply Updates at a Future Time.