Click Once Deployment

Click Once Deployment

With ClickOnce deployment, developers browse to Window applications published on an ASP.NET Web server. Setup and deployment of desktop and non-Web applications have recently become increasingly complex. In addition, installation must be repeated for updates and future versions of the product. There is also the productivity problem of having to physically install the product on multiple machines. Conversely, deployment of Web applications is hands-free. You simply browse to the application using the proper URL. No installation required. Web applications are also self-updating. Users automatically obtain the latest version of the Web application whenever the Web site is browsed. Productivity is improved because per-machine installations are avoided. The benefits of a Web distribution extend to ClickOnce deployment.

ClickOnce deployment is nonintrusive. Windows Installer technology is intrusive as the application is installed to the local machine. ClickOnce deployment downloads an application into the download cache, in which there is limited impact to the local machine. There are security considerations because these applications execute in the download cache with potentially limited security privileges. These security considerations must be addressed in the application or on the local machine. Because the deployment is hands-free, user experience is improved.

ClickOnce applications are self-updating, which is particularly useful for applications that require frequent updates. Deploying applications that require frequent updates within the Windows Installer technology model was a time-consuming process. ClickOnce applications are deployed once and updated online automatically. Updates require online connectivity.

Another benefit includes the security privileges required to perform an installation. Windows Installer technology sometimes required administrative permissions, but ClickOnce deployment does not require administrative permissions to deploy the application.

ClickOnce deployment publishes an application at a Web site on an ASP.NET server. The client machine must support the .NET Framework. This is more likely in an intranet deployment, in which the desktops are controlled. It is also feasible in an extranet environment, in which requirements can be published and a reasonable level of compliance can be expected. ClickOnce applications can be deployed in a traditional manner, but require online connectivity for self-updating.

ClickOnce deployment has two modes of deployment. The online-only mode executes the application from the Web, which requires the client to be connected to the server computer whenever the application is executed. The full installation mode executes the installation on the client computer. This is similar to a traditional installation from an .msi or .cab file. Updates still require online connectivity.

ClickOnce deployment uses an application manifest (which is an XML file) to define dependent assemblies, files, and security permissions required for the application. ClickOnce deployment also uses a deployment manifest. This manifest contains deployment configuration information, such as the current version, the location of required files, deployment mode, and update policies.

Create application and deployment manifests with the Manifest Generation and Editing (MageUI) tool, which is distributed in the .NET Framework. To create a new application manifest, choose the File menu and then choose the New submenu. From the submenu, select Application Manifest The Name window of the application manifest appears first. This window contains the general information on the deployment. The Airline Seats application is published as a ClickOnce application. Figure 4-41 shows a view of the Name window in the MageUI tool for the Airline Seats application.

Image from book
Figure 4-41: Application manifest—Name window

The Files window lists the files included in the deployment. (See Figure 4-42.)

Image from book
Figure 4-42: Application manifest—Files window

The Permissions Required window sets the security required to execute the deployed application.(See Figure 4-43.)

You can also open the deployment manifest using the MageUI tool. The Names windows for both the deployment and application manifests are the same. For the deployment manifest, the two most important windows are the Deployment and Update Options windows.

Image from book
Figure 4-43: Application manifest—Permissions Required window

The Deployment Options window sets the ClickOnce deployment mode and the URL of the published application. (See Figure 4-44.)

The Update Options window configures how updates are managed for an application deployed with ClickOnce technology. Figure 4-45 shows the Update Options window.

Image from book
Figure 4-44: Deployment manifest—Deployment Options window
Image from book
Figure 4-45: Deployment manifest—Update Options window

Publish a ClickOnce Application

Fortunately, ClickOnce deployment is automated in Visual Studio 2005. This includes the creation of both manifest files and Web server configuration. In Visual Studio 2005, developers use the Publish Wizard to set up an application for ClickOnce deployment. Open the project shortcut menu and choose Publish to launch the Publish Wizard.

The Publish Wizard has several steps. The first step provides the URL in which the application is published. Figure 4-46 shows the first window of the Publish Wizard.

Image from book
Figure 4-46: Publish Wizard—step 1

Step 2 of the Publish Wizard sets the online connectivity requirements of the deployed application. (See Figure 4-47.)

Step 3 (shown in Figure 4-48) is the confirmation window, in which a developer can review the ClickOnce settings and confirm the deployment.

Image from book
Figure 4-47: Publish Wizard—step 2
Image from book
Figure 4-48: Publish Wizard—step 3