Introduction
ClickOnce is an easy way of deploying a Windows application via a website, FTP server or file path. There are four ways of publishing an application using ClickOnce, which we are going to see the advantages and disadvantages of here. The four ways of publishing an application via ClickOnce are:
- Publish via publish wizard, which is available in the IDE of Visual Studio.
- Publish via mage.exe.
- Publish via mageUI.exe.
- Publish via Team Build in Team Foundation Server.
Publish via Publish Wizard
In order to go to the publish wizard, right click on the Visual Studio project and select Properties. In the Properties window, click on the Publish tab. This will open up the ClickOnce Publish Properties window.
Advantages
- The system automatically detects the dependency DLL for publishing, which is referred to in the project.
- Easy-to-use publish wizard for step-by-step configuration setup.
- The pre-requisite file (setup.exe) for the application is automatically created.
Disadvantages
- The publish properties are part of the Visual Studio project and hence in a team environment we normally don’t want all the members of the team to have access to the publish task.
Publish via mage.exe
Manifest generation and editing tool (mage) is a command line EXE that is available in C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin. The folder structure may be different based on where Visual Studio is installed.
Advantages
- Can be called in a batch file.
- Can be used by the administrator independent of the Visual Studio IDE who has sole authority over the production environment.
Disadvantages
- mage.exe does not provide facility to specify if the users will get an update when starting the application. See this forum for more information.
- There is no facility to specify and create pre-requisite files (.NET framework) for the application.
- The application EXE and DLL paths need to be specified, as the tool does not automatically ascertain them.
Publish via mageUI.exe
The manifest generation and editing tool (mageUI.exe) is a user Interface EXE that is available in C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin. The folder structure may be different based on where Visual Studio is installed.
Advantages
- Can be used by the administrator independent of the Visual Studio IDE who has sole authority over the production environment.
- Have all the features similar to the integrated publish function of Visual Studio IDE.
Disadvantages
- The administrator may need to spend some time in entering the properties for the application and development manifest while publishing. This disadvantage can be overcome by reusing the previous application and deployment manifest via changing few things like version and file path for application.
Publish via Team Build in Team Foundation Server
In the Team Explorer window, right click on Team Build to create a new build type. The publish properties can be set up as XML elements, i.e. the application and deployment manifest configuration settings can be specified as XML elements. Please see this Microsoft link for the XML elements.
Advantages
- It comes with Team Build, making the build and publishing processes in an integrated environment.
Disadvantages
- Whenever the build happens, the publish files are automatically also generated, leaving the administrator with no control of when to create publish files.
- The XML elements and values need to be manually entered and are error-prone.
I came up with the idea of writing this article when I found myself searching the web for evaluating which ClickOnce deployment strategy to go for. Please feel free to ask any questions and I hope to answer as soon as possible.
History
- 11 December, 2007 -- Original version posted