Introduction
This is a continuation of my previous article on Click Once Deployment in Visual Studio. In my previous article (Click Once Deployment Technique), I discussed the basics of Click Once Deployment. In this article, I am going to discuss few very important options and settings regarding the deployment destination and the deployment items.
Start Menu Name for a ClickOnce Application
When a ClickOnce application is installed, an entry is added to the Start menu and the Add or Remove Programs list. By default, the display name is the same as the name of the application assembly, but we can change the display name by setting Product name in the Publish Options dialog box.
Product name will be displayed on the publish.htm page or any specified start page of deployment unit. For an installed offline application, it will be the name of the entry in the Start menu, and it will also be the name that shows in Add or Remove Programs.
Publisher name will appear on the publish.htm page above Product name, and for an installed offline application, it will also be the name of the folder that contains the application's icon in the Start menu.
We can set the Product name and Publisher name properties in the Publish Options dialog box. Right click the project and click on Properties to get the Property window and then click on Publish Tab for making the settings for deployment. Click on the Options button and in the Publish Options Dialog box, we can put in the Product and Publisher name. Refer to the following screenshot:
Selecting Files to be Made Available in Deployment Unit
When publishing a ClickOnce application, all non-code files in the project are deployed along with the application. In some cases, you may not want or need to publish certain files, or you may want to install certain files based on conditions. Visual Studio provides the capabilities to exclude files, mark files as data files or prerequisites, and create groups of files for conditional installation.
Files for a ClickOnce application are managed in the Application Files dialog box.
Initially, there is a single file group named (Required). We can create additional file groups and assign files to them. However we cannot change the Download Group for files that are required for the application to run. For example, the application's .exe or files marked as data files must belong to the (Required) group.
The default publish status value of a file is tagged with (Auto). For example, the application's .exe has a publish status of Include (Auto) by default. Refer to the screenshot below.
Files with the Build Action property set to Content are designated as application files and will be marked as included by default; they can be included, excluded, or marked as data files.
The exceptions are:
- Data files such as SQL Database (.mdf and .mdb) files and XML files will be marked as data files by default.
- References to assemblies (.dll files) are designated as follows when we add the reference: If Copy Local is False, it is marked by default as a prerequisite assembly (Prerequisite (Auto)) that must be present in the GAC before the application is installed. If Copy Local is True, the assembly is marked by default as an application assembly (Include (Auto)) and will be copied into the application folder at installation. A COM reference will only appear in the Application Files dialog box (as an .ocx file) if its Isolated property is set to True, and it will be included by default.
Exclude Files from ClickOnce Publishing
Right click the project and click on Properties to get the Property window and then click on Publish Tab for making the settings for deployment. Click on the Application Files button and in the Application Files Dialog box, we can select Exclude in Publish Status Field corresponding to the file. Refer to the screenshot below.
Mark Files as Data Files
Right click the project and click on Properties to get the Property window and then click on Publish Tab for making the settings for deployment. Click on the Application Files button and in the Application Files Dialog box, we can select File(s) that we want to mark as data and then in Publish Status Field select Data File from the drop-down list. Refer to the screenshot below.
Mark Files as Prerequisites
Right click the project and click on Properties to get the Property window and then click on Publish Tab for making the settings for deployment. Click on the Application Files button and in the Application Files Dialog box, we can select the application assembly (.dll file) that we wish to mark as a prerequisite. Note that our application must have a reference to the application assembly in order for it to appear in the list. In the Publish Status field, select Prerequisite from the drop-down list. Refer to the following screenshot:
Conclusion
So, we learnt few options regarding the selection of files and setting up the Product and Publisher name. For further studies, please refer to this URL.
History
- 30th July, 2009: Initial post