ClickOnce Deployment Architecture
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 handles each published version of an application as an atomic unit. That publication consists of the deployment manifest, application manifest, and all the application files for that version. The publish version is specified through the deployment manifest, and each deployment manifest refers to a single application manifest and its associated collection of application files.
The client computer must have the .NET Framework 2.0 or later versions installed to do a ClickOnce deployment to that computer. The .NET Framework can be deployed a variety of ways, including Windows Update, Microsoft Systems Management Server, or the ClickOnce Bootstrapper. The only specific platform requirement on the server side is the ability to return the manifests and application files with the appropriate MIME types.
To understand where everything goes in a ClickOnce deployment, it is best to perform the steps of a deployment and update from an architecture view. When a ClickOnce application is first published, the files are placed on the deployment server and the deployment manifest refers to the most recently published version. At this point, no changes have been made to the client computer (see Figure 1).
After publishing, before deployment
After the user clicks a link to the deployment manifest, the initial deployment of the application occurs and the application files are copied to the client computer under the user's profile. If the application is deployed as an installed application, a Start menu shortcut is added and an Add or Remove Programs item is added. The application launches, and the user interacts with the application as a locally installed smart client application (see Figure 2). The user can continue to use the application by launching it from the Start menu shortcut.
After initial ClickOnce deployment
At some point in the future, an update is published to the deployment server. The earlier version of the application may or may not be removed from the deployment server at that time. The default deployment manifest for the application is updated to point to the new version of the application (see Figure 3).
New version published to server
With the default ClickOnce update settings, the next time the user launches the application on the client computer, the ClickOnce runtime on the client computer detects that a new version is available on the server. A new version is created under the user's profile on the client computer, and the application files for the new version are copied into that folder. If a file from the previous version is unchanged between versions (determined by a hash of the file placed in the application manifest), it is copied locally on the client computer from the previous version's cache folder. If a file has changed or is new, it is downloaded from the server and cached in the new version's cache folder under the user's profile. The Start menu shortcut is updated, and the new version of the application is launched on the client computer (see Figure 4).
Update detected and deployed to client computer
Note that the previous version is not removed from the client computer when a new version is installed. This allows the user to roll back to the previous version through Add or Remove Programs if the Minimum Required Version property is not set in the new version by the publisher. ClickOnce keeps only one previous version cached on the client computer for installed applications.