CanOz Blog

Neil Knobbe's Blog at vbCity

vbCity Blogs moved to:
http://cs.vbcity.com/blogs
  Home :: Syndication  :: Login

OctNovember 2009Dec
SMTWTFS
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

Archives

Image Galleries

vbCity Blogs

ClickOnce Deployment

A recent post on vbCity regarding deploying an application with ClickOnce got me wondering about doing deployment with ClickOnce.

I have always done deployment of applications by creating and using a Setup and Deployment package which created a .msi installer file, so it was interesting to see some of the differences between the two distribution methods.

First off I created a simple application to test the ClickOnce distribution and installation method with.  What I created was nothing special, just a windows form with at button that, when it is clicked, a message box is shown.

 

As you can see the application is nothing special.  One other thing that I did was add a version number to the text of the form.  I did this to show how ClickOnce deployment installs newer versions as they are available.  I will get to this a little later.

Once your application is ready to go you want to open up the My Project page from the solution explorer.

On the My Project  page click the Publish tab.

From this page, you define where your application is going to be available from and how it is going to be installed on the client machine.

Taking a look at the publish page from the top down the first thing you will want to enter will be the location (URL) that you are going to publish to.

As you can see from the image above, you have three options for the location that you are going to publish to.  You can publish to a web site (http://www.somesite.com) but to do this you must have FrontPage extensions enabled on the web site.  You can publish to a ftp server (ftp://www.somesite.com) as long as you have ftp permissions for the site, or you can publish to a local file (C:\myApplication). (For distribution this last option is not really that realistic unless you are on an internal network where you can share out the directory to others on the network.)

The next option you have is to determine if you application is available offline or not.

If you don’t want the users to be able to access your application offline then select the online option.  This will cause your application to run, but not show in the start menu of the user’s computer.  They would need to download the application each time they wanted to use your application. 

If you make the application available offline then a shortcut is included in the start menu of the computer making the application accessible all the time.

To the right of the Install settings there is a group of four buttons.

These buttons define what files are to be included with your application, any prerequisites that the end user must have installed on their computer to run your application, how and when to get updates as well as options such as adding the publishers name, product name etc.

Under the install mode and the buttons there is the version boxes plus the option to automatically increment the revision with each publish.

Keeping the increment box checked is, I believe, quite important.  If you don’t remember to increment the version number when you republish the application then the next time the application checks for updates it looks at the version number and if that number has not changed, even though your application may have, it assumes that there is nothing newer and opens the currently installed version.

The last two items on the window are the Publish Wizard and Publish Now buttons.

The Publish Wizard button will open a series of dialogues and walk you through the settings that you want your installer to use.

The Publish Now button will use the information that you have entered on the page and create the installer files then, if you are deploying the files to either a web site or ftp site, prompt you for log on details.

Simply insert your username and password then click the OK button and the files required will be uploaded to the URL you specified.

You can see in the image above that ClickOnce has created two files and one directory on the web server.  Within the Application Files directory you would find one directory containing each version that has been published and uploaded.

I just happen to have two versions in the application files directory and the one that will get distributed will always be the latest version. (I mentioned earlier that I had put a version number on the text of the form and the version number you should see is 2 not 1 like the image of the form above.) It would not matter how many older versions I have on my server.

Now you may distribute the address of your application to your clients.  The file that you want to point to is the Application Manifest file, not the setup file.  From the image above I would point people to the URL http://www.neilknobbe.com/clickonce/ClickOnce.application.  (The link is live and you can navigate to it, download and install the application that I mentioned at the start of this post.  It is not very exciting, but it shows how ClickOnce works.)

The prerequisites for installation, which you would have set earlier, are checked.

If all is ok, the user will be prompted to install the application.

Once installed your ClickOnce deployed application is ready to use.

posted on Saturday, May 03, 2008 7:49 PM

Feedback

No comments posted yet.

Post Feedback

Title:
Name:
Url:
Comments: 
Protected by Clearscreen.SharpHIPEnter the code you see: