Tuesday, May 18, 2010

ClickOnce

Advantage of using ClickOnce

1. windows installer deployment requires administrator privileges where is normal user can do installation using ClickOnce
2. ClickOnce allow to set automatic application updates
3. There will not be any version conflicts using ClickOnce



Requirement: Need to deploy a console based application to all the machines in the network. And whenever there is any functionality addition to application it should update in already installed the applications in the network.














Solution: Use ClickOnce feature provided by Microsoft along with visual studio 2005.

People were not preferred to develop any winforms/console applications before introduction of ClickOnce feature. This is because deployment & maintenance was an overhead.

ClickOnce helps you to deploy your WPF, winforms or console application in any machines in the network or any standalone machines. There are 3 ways in which we can achieve this.

  1. Publish using http
  2. Copy to shared folder in server.
  3. Write to CD/DVD
Here are the steps for Publish using http.

Make your changes in the application and set assembly version in assemblyInfo.cs file




You could also check assembly version at Project-Properties-Publish tab- Modify publish version



Use publish option under build menu for publishing the changes using http




 
Click on Next





Click on Finish, Brower opens up with the publish details. Choose Install button to install the software










Now big question: Say I am a user in the network and I have already installed the application. So whenever a new patch is updated or new functionality is added, I want those changes to reflect in my application automatically.


ClickOnce give an option to configure this. It is called as Update Strategy. This can be achieved in 3 ways:

  1. After starting up the application
  2. Before starting up the application
  3. making the updates required

I am going with before starting up the application. This option can be set using Project-Properties-Publish tab-Click on Update button.






Say I have updated my application or I did some code change, I am going to publish it in to the website





Repeat the publish steps.





You get the updates when you click on Ok



 
How it works: I guess it is based on publisher-Subscriber policy.

No comments: