Click here to Skip to main content
12,446,418 members (55,483 online)
Click here to Skip to main content
Add your own
alternative version

Stats

188.1K views
1 download
116 bookmarked
Posted

ClickOnce - Quick steps to Deploy, Install and Update Windows Based Client Applications

, 9 Jan 2007 CPOL
Rate this:
Please Sign up or sign in to vote.
Easy Steps for IT and Deployment Team to setup and deploy Windows based application using Microsoft ClickOnce Deployment Tool which is part of Visual Studio 2005

Introduction

This article presents quick and clear steps for the click once deployment techniques for the Infrastructure and Developer/Deployment Team. It covers the web server setup, directory structure, file share and permission tips on the deployment server and basic steps for the developers to deploy and general troubleshooting.

ClickOnce is simple to configure and use without leaving the Visual Studio environment. It is easy to deploy the windows based client application using the interactive tool. The application can be distributed to install and to receive updates in the forms of URL, URI and CD media.

ClickOnce is definitely an advantage over the previous generation of Install and Updater tools provided by Microsoft. There is no need to add a setup/MSI project or struggle with the manifest tool by Application Updater Block anymore.

Upon the install, it creates a shortcut under Programs-->CompanyName-->Product directory. The user should also be able to Remove or Repair the application using Windows "Add or Remove Program" utility.

Deployment Web Server Setup

Sample image

In this example, the deployment server is "MyAppUpdater". It has limited access to all the users but it has shared directory with permissions to the developers as, \\MyAppUpdater\ApplicationUpdater\ to host the deployment files.

Sample image

There is no need to create the subdirectory or browse to the directory. ClickOnce from the VS2005 IDE creates them automatically for us. Follow the steps below for a quick guide to the deployment.

Publish from Visual Studio 2005

When ready to deploy the application, browse to the property of the StartUp Project, choose Publish tab.

Screenshot - publish1.JPG
  • Publishing Location can be a file path to the \\MyAppUpdater\ApplicationUpdater\MyDeploymentDirectory
  • Install URL is the published URL used by the installer.
  • "Application is available offline as well" is the most used option.

Now click on "Application Files" button to setup the application you would like this publish version to include.

Sample image

Make appropriate selection for the DLLs if they are needed to copy (Include) or Prerequisite.

Click on "Prerequisites" button next:

Sample image

.NET Framework is a prerequisite for .NET application to run on client machine which does not have .NET Framework installed. When installing this application, ClickOnce checks to see if DOTNETFX2.0 is not installed and installs it. Eliminate the extra steps needed otherwise to download and install the DOTNETFX to the client machines.

Click on "Updates" button to setup the download option.

Sample image

You can choose either Before or After application starts option to control the user experience. The application should check for updates to control if this deployment would receive any updates to the products when published to the Publishing Location.

Now click on "Options" button to setup additional information for the install and update like Support URL, Product and Publisher name, etc.

Sample image

Most commonly used options are selected in the image below.

"Deployment web page", by default it is always publish.htm, *** a tip is to configure the deployment web server such that the default page is publish.htm, it would save extra keystrokes each time there is an attempt to install from the server or deploy to the server.***

Click on "Publish Now" button. It should start deploying the application on the deployment server. When finished, it would then launch the Installation URL.

Screenshot - publishedApp.JPG

You are ready to distribute the Installation URL to the user or if CD Installation is selected, it would publish in the CD and it is ready to be distributed.

Troubleshooting

This application has failed to start because the application configuration is incorrect.

Screenshot - ts1-1-small.jpg

This is the most commonly seen error. Fix to this is, change the app.config file encoding to "utf-8" instead of default "Windows-1252" as displayed below:

Screenshot - ts2.JPG

For other kinds of error, you might need to open the Event Viewer.

Another most common error is when trying to deploy IIS does not allow the files to be downloaded.

The reason being, IIS does not allow to downloading file with .config, .deploy, .application extension for security reasons. Modify the MIME Types for this website to allow these extensions by registering the MIME types for the file extension type as displayed below:

Screenshot - iis1_small.jpg

Give away the Installation URL, http://applicationUpdater.UltimateProductComapny.com/ProductLaunchKit/ to the users to install for the first time, after that each time the user opens the app, it would check for the auto update and download if a new one is available.

Happy installing, updating and distributing the smart Windows based client application you write. Smile | :)

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Preeti Baranga
Web Developer
United States United States
Preeti is working as software developer since the begining 1999 after her post graduation as MS in Computer Science.
She has contributed 4 years towards Java development. She started writing code for .NET since mid 2003.
Preeti's LinkedIn Profile

In her free time Preeti spends time with her two little yet highly energetic kids, rock climbing, mountain biking, ice skating and reading fiction novels.

You may also be interested in...

Comments and Discussions

 
QuestionDeploy ClickOnce through group policy Pin
Lokesh Zende16-Aug-16 23:52
professionalLokesh Zende16-Aug-16 23:52 
Questionthanxx Pin
kawish844-Oct-14 1:11
memberkawish844-Oct-14 1:11 
GeneralMy vote of 5 Pin
URVISH SUTHAR from Ahmadabad Gujarat, India29-Dec-11 1:05
memberURVISH SUTHAR from Ahmadabad Gujarat, India29-Dec-11 1:05 
GeneralMy vote of 4 Pin
ajay12456316-Aug-11 21:18
memberajay12456316-Aug-11 21:18 
GeneralPlatform Target Pin
Prasanta Bhowmik9-Jan-11 23:55
memberPrasanta Bhowmik9-Jan-11 23:55 
QuestionDo you have any additional information since your original article? Pin
MisterT9911-Nov-10 9:14
memberMisterT9911-Nov-10 9:14 
GeneralClick once with a Web service to be use by a windows application Pin
cocis4821-Jul-09 7:14
membercocis4821-Jul-09 7:14 
QuestionMy Application creates 2 directories Pin
Member 238974615-Jun-09 5:19
memberMember 238974615-Jun-09 5:19 
AnswerRe: My Application creates 2 directories Pin
tleforge14-Jul-09 8:44
membertleforge14-Jul-09 8:44 
AnswerRe: My Application creates 2 directories Pin
d72e4d16-Jul-10 1:06
memberd72e4d16-Jul-10 1:06 
GeneralNice article Pin
akshayswaroop13-Feb-09 0:32
memberakshayswaroop13-Feb-09 0:32 
GeneralI have never got ClickOnce to work Pin
RugbyLeague16-Jan-09 0:40
memberRugbyLeague16-Jan-09 0:40 
GeneralChange app.config after Publish [modified] Pin
alhambra-eidos6-Sep-08 1:39
memberalhambra-eidos6-Sep-08 1:39 
GeneralDeveloping .NET-framework-Independent Applications Pin
Gabriel X20-Dec-07 8:01
memberGabriel X20-Dec-07 8:01 
QuestionOnly Wizard?? Pin
Member 38418114-Dec-07 13:26
memberMember 38418114-Dec-07 13:26 
GeneralNeed Help to Create setup Pin
Muhmmad saqib17-Sep-07 22:40
memberMuhmmad saqib17-Sep-07 22:40 
QuestionClickOnce in Apache Server Pin
Neal Sualog29-Jul-07 17:39
memberNeal Sualog29-Jul-07 17:39 
QuestionClick once API use Pin
pratap ankesh12-Jun-07 1:18
memberpratap ankesh12-Jun-07 1:18 
GeneralDistributing help files Pin
Madhu Kampurath31-Jan-07 4:31
memberMadhu Kampurath31-Jan-07 4:31 
GeneralWord of caution! Pin
Preeti Baranga10-Jan-07 18:41
memberPreeti Baranga10-Jan-07 18:41 
GeneralClickOnce is Useless out of the Box Pin
CliffStanford10-Jan-07 10:08
memberCliffStanford10-Jan-07 10:08 
GeneralRe: ClickOnce is Useless out of the Box [modified] Pin
Preeti Baranga10-Jan-07 18:34
memberPreeti Baranga10-Jan-07 18:34 
GeneralRe: ClickOnce is Useless out of the Box Pin
CliffStanford11-Jan-07 0:27
memberCliffStanford11-Jan-07 0:27 
GeneralRe: ClickOnce is Useless out of the Box Pin
Muammar© 29-Jan-08 22:58
member Muammar© 29-Jan-08 22:58 
General!!!!! be aware Pin
HB HB9-Jan-07 14:43
memberHB HB9-Jan-07 14:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160811.3 | Last Updated 9 Jan 2007
Article Copyright 2007 by Preeti Baranga
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid