Configuring a ClickOnce Deployment
Publish Options: ManifestsUnder the Manifest section, you'll find the dialog below with five check box options used to configure the manifest files used during the deployment of the application.
Listing 1.6 The Manifests screen of the Publish dialog
- Block application from being activated via a URL: This option controls whether or not the application can be launched from a URL call. If this box is checked, the application will be required to launch from the Start menu. Additionally, disabling this option allows the application to start automatically after installation.
- Allow URL parameters to be passed to application: This option enables the application to accept URL parameters. The parameters are then stored in the ActivationUri object to be retrieved in the application code.
- User application manifest for trust information: This option controls if the deployment uses the default Microsoft certificate information or your own certificate. If you are looking to control the publisher and product name via certificate on the security/trust dialog (before installation), use this option and sign with your own or your company's certificate. Custom certificates can aid in hiding the security/trust dialog when you have full control over the machines on which the application will be installed (e.g. a network environment).
- Exclude deployment provider URL: This option is new to VS 2008 SP1. This setting can be used if the update location is indeterminate at the time of initial release, in which case the application will check for updates from wherever it was initially installed.
- Create desktop shortcut: This option is also new to VS 2008 SP1. It controls whether or not the deployment creates an icon shortcut on the desktop. This is an exciting new feature for ClickOnce; prior to SP1, it was not possible to create desktop shortcuts unless you had control over the machines via SMS or some other method.
ERROR SUMMARY Below is a summary of the errors, details of these errors are listed later in the log. * Activation of http://gobi/ClickOnceDeployment/ClickOnce%20Demo.application resulted in exception. Following failure messages were detected: + Exception reading manifest from http://gobi/ClickOnceDeployment/ClickOnce%20Demo .application: the manifest may not be valid or the file could not be opened. + Deployment manifest is not semantically valid. + trustUrlParameters and disallowUrlActivation cannot both be true at the same time.
Publish Options: File AssociationsIn the File Associations section, you'll be able to configure and associate file extensions for your application that are then configured on the user's PC during deployment. This is a new feature in VS 2008 SP1 / .NET 3.5 SP1 that opens up traditional file save and open functionality that has been previously missing from ClickOnce deployed applications.
Listing 1.7 The File Associations screen of the Publish dialog
Note that all four fields are required and if not populated will be flagged with a red exclamation point. They are as follows:
- Extension: It is important to include the "." and for the extension to be unique. If the extension is found not be unique upon installing, the association will not succeed.
- Description: This will display as the hover-over text in Windows.
- ProgID: This is a name used to identify the file type.
- Icon: You can browse to select an .ico file to use for the files' icon in the file system.
ConclusionWe have discussed all of the ClickOnce deployment options available on the Publish tab's Options dialog. With exposed configuration for many of the most common features required when installing a desktop application, now you can configure your ClickOnce application to perform exactly as you like. VS 2008 SP1 offers some additional features for improved deployment options.
About the AuthorsMatt Goebel is a manager with Crowe Horwath LLP in the Indianapolis, Indiana, office. He can be reached at 317.208.2555 or matt .email@example.com.
Rachel Baker is a senior developer with Crowe Horwath LLP in the Oak Brook, Illinois, office. She can be reached at 630.990.4434 or rachel .firstname.lastname@example.org.
Page 3 of 3