Click here to Skip to main content
13,801,907 members
Click here to Skip to main content
Add your own
alternative version


428 bookmarked
Posted 16 Jul 2007
Licenced CPOL

Adding automatic updates to your program - Part 1

, 31 Dec 2007
Rate this:
Please Sign up or sign in to vote.
This article describes the steps to add automatic update capabilities to your application quickly and easily using the DDay.Update library.


In today's world, applications are quickly moving towards a simple, all-encompassing distribution model. Web applications are gaining popularity because of their scalability and ease of deployment, and desktop applications are becoming less common. This holds both positive and negative consequences - mainly with functionality and user experience.

Most applications need to ensure the best user experience possible for any given situation. In many cases, a web site meets the needs of both the developer and the consumer. However, some applications are better suited as a client-side, distributed application.

For these applications, the need arises for an easy and reliable method of deployment that allows the application the flexibility for any scenario. It should gracefully handle updates to the application, and be easily managed remotely. For this reason, DDay.Update came into existence - to provide an easy interface for adding automatic update functionality to your application, avoiding most of the headache involved in the update process, while allowing the most flexibility possible.


The technology that will be presented uses Microsoft's ClickOnce publishing mechanism that is built into Visual Studio 2005. It does not use ClickOnce itself. This is for many reasons:

  1. It's difficult to use your own deployment methods (use Windows Installer, for example) and still use ClickOnce for automatic updates.
  2. You cannot easily update individual files with ClickOnce, it's an all-or-nothing update, by default. This becomes problematic when your application is anything but very small in size, or you have very few users.
  3. To use a different GUI with ClickOnce requires a complete, built-by-hand interface. DDay.Update's GUI is pluggable. There is currently a pre-built interface for Windows Forms 2.0, and one will soon be available for .NET 3.0 (WPF).
  4. DDay.Update does not interfere with your application's security permissions.
  5. Open source applications lend to a better understanding of the underlying technology. Since DDay.Update and all its controls are open source, you are free to study and extend the code.

That said, if you haven't already, I encourage you to give ClickOnce a try. You may find that it suits your needs. When you find some of its features lacking, then give DDay.Update a try.

Note: DDay.Update is not a wrapper for ClickOnce. It simply consumes ClickOnce manifest files.

OK, what now?

In this article, I will present a bare-bones application, and give it automatic update functionality.


First, download the most recent binary version of DDay.Update from It is also included in this article for convenience.

Once downloaded, you're ready to begin.

We will now go through the following steps:

  • Step 1 - Create an application to be automatically updated
  • Step 2 - Publish the application
  • Step 3 - Create a Bootstrap application
  • Step 4 - Test it out

Step 1 - Create an application to be automatically updated

Create a new Console project in Visual Studio. Click File->New->Project, and select "Console Application" from the list. I named mine "AutoUpdatingApplication". You can choose whatever name you'd like (though it may be easier to follow examples if you use the same name).

Add a basic line of code to this application, such as:

Console.WriteLine("This is my application.");

Step 2 - Publish the application

We will use Visual Studio's ClickOnce mechanism to publish this simple application. This process is very simple. If you already know how to publish a ClickOnce application, skip to Step 3.

First, right-click on your console application project, and select "Properties".

Screenshot - ProjectProperties.png

Then, click on the "Publish" tab on the left, and click the "Publish Wizard" button:

Screenshot - PublishTab.png

Then, follow the steps of the wizard. Here's what I did:

Screenshot - PublishWizardStep1.png

Screenshot - PublishWizardStep2.png


Click "Finish", and your application should now be published to the location you indicated in the first step of the wizard. In my case, it's "C:\Deployment\DDay.Update.Test".

That's it, your application should now be published through ClickOnce!

Step 3 - Create a Bootstrap application

DDay.Update uses a bootstrap application to "mimic" the look and feel of your "real" application. In order to create this Bootstrap application, you need to use the Configuration Tool included in the binary distribution of DDay.Update.

First, open the Configuration Tool that you downloaded in the Preparation step of this example. Then, select File -> Open Deployment Manifest.


You will then see the following screen:


Enter the location where you published your application. This will include the name of your project, with a .application extension. In my case, it's:


Then, click Open. You will then see the main configuration screen, with some information automatically determined. The Update URI should already be provided - if it isn't, it should match the location where you published your application. In my case, it's C:\Deployment\DDay.Update.Test. When an Update URI is provided, you can click the "Verify URI" button to ensure that the URI is valid:


Then, choose an update notifier. This is the "pluggable" GUI that DDay.Update uses to display update information to the user.

Afterwards, choose a destination folder for the Bootstrap application to be created. I added a new folder on my desktop:

Screenshot - ConfigToolDestFolder.png

When you've completed these steps, you're ready to build the Bootstrap application. Click the "Create Bootstrap" button, and you should see a message as follows:

Screenshot - ConfigToolBootstrapSuccess.png

Then, the destination folder will automatically open, and you'll see your brand-new Bootstrap! If you run the executable in that folder, you'll see your application download the most-recent version and run it, and your folder will look like this:

Screenshot - ConfigToolDestFolderOpened.png

Notice the folder named "". That's where your "real" application is stored.

Congratulations, you've setup your application to automatically update!

Step 4 - Test it out

To see the update in action, open Visual Studio again, and publish a new version of your application. Then, go back to the "destination folder" where you created your Bootstrap, and run the application. You should see a message as follows:

Screenshot - Bootstrap_UpdateAvailable.png

Select "Upgrade Now", and the new version will download and run. You'll also notice that the directory structure of your application looks like this:

Screenshot - ConfigToolDestFolderOpenedUpgraded.png

Notice the new "" folder. The new version of the application has been placed here.

Note: If you chose "Upgrade Later", version will be run, and no updating will occur.

That's it!

Your application is now automatic-update-enabled.

Important information

When you distribute your application to your users, simply give them the Bootstrap application instead of the "real thing", and they will always receive automatic updates. You can even deploy your applications to your users through this method - no need to have them download your large application all at once. They can download the bootstrap application, and it will download the rest.

Points of interest

DDay.Update is in mid Beta testing. If you see anything strange or unexplained, please let me know by submitting a bug report here.


  • 12/31/2007 - Article updated (Version 0.63)
  • 11/13/2007 - Article updated (Version 0.61.1)
  • 11/12/2007 - Article updated (Version 0.61)
  • 07/23/2007 - Article updated
  • 07/16/2007 - Initial revision (Version 0.52)


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


About the Author

Douglas Day
Web Developer
United States United States
Doug has been a Software Engineer for 7 of the previous 9 years, and has 12 years of programming experience.

For the past 3 years, he has been developing custom applications in C# and Visual Basic.NET, with an emphasis on custom cross-Internet applications for IT management, real-time collaboration, and process management and reporting.

You may also be interested in...

Comments and Discussions

QuestionJust a few questions :P Pin
Anthony Daly31-May-09 6:04
memberAnthony Daly31-May-09 6:04 
AnswerRe: Just a few questions :P Pin
Douglas Day1-Jun-09 5:50
memberDouglas Day1-Jun-09 5:50 
GeneralRe: Just a few questions :P Pin
Anthony Daly1-Jun-09 9:14
memberAnthony Daly1-Jun-09 9:14 
GeneralRe: Just a few questions :P Pin
Douglas Day1-Jun-09 9:33
memberDouglas Day1-Jun-09 9:33 
GeneralRe: Just a few questions :P Pin
Member 27464334-Oct-10 2:49
memberMember 27464334-Oct-10 2:49 
GeneralRe: Just a few questions :P Pin
Douglas Day4-Oct-10 5:38
memberDouglas Day4-Oct-10 5:38 
GeneralNot Working for application Pin
hossamgamal20-May-09 3:51
memberhossamgamal20-May-09 3:51 
GeneralRe: Not Working for application Pin
Douglas Day20-May-09 4:30
memberDouglas Day20-May-09 4:30 
GeneralRe: Not Working for application Pin
hossamgamal23-May-09 23:21
memberhossamgamal23-May-09 23:21 
GeneralFor update i am getting Pin
Member 29555525-Feb-09 1:21
memberMember 29555525-Feb-09 1:21 
Generalconfigfile again / usersettings Pin
rber4-Feb-09 4:46
memberrber4-Feb-09 4:46 
AnswerRe: configfile again / usersettings Pin
Douglas Day4-Feb-09 6:30
memberDouglas Day4-Feb-09 6:30 
GeneralYour favorit customer with another question ;) Pin
mjmim27-Jan-09 14:33
membermjmim27-Jan-09 14:33 
GeneralRe: Your favorit customer with another question ;) Pin
Douglas Day28-Jan-09 6:16
memberDouglas Day28-Jan-09 6:16 
QuestionWhy? Pin
Phil.Benson18-Jan-09 0:02
professionalPhil.Benson18-Jan-09 0:02 
AnswerRe: Why? Pin
Xcalllibur18-Jan-09 3:45
memberXcalllibur18-Jan-09 3:45 
AnswerRe: Why? Pin
Douglas Day19-Jan-09 6:44
memberDouglas Day19-Jan-09 6:44 
GeneralRe: Why? Pin
Phil.Benson20-Jan-09 7:56
professionalPhil.Benson20-Jan-09 7:56 
GeneralRe: Why? Pin
Douglas Day20-Jan-09 8:07
memberDouglas Day20-Jan-09 8:07 
GeneralRe: Why? Pin
Phil.Benson20-Jan-09 11:35
professionalPhil.Benson20-Jan-09 11:35 
GeneralRe: Why? Pin
Douglas Day20-Jan-09 11:42
memberDouglas Day20-Jan-09 11:42 
GeneralRe: Why? Pin
Phil.Benson20-Jan-09 11:55
professionalPhil.Benson20-Jan-09 11:55 
GeneralRe: Why? Pin
Douglas Day20-Jan-09 11:58
memberDouglas Day20-Jan-09 11:58 
GeneralRe: Why? Pin
Douglas Day20-Jan-09 11:55
memberDouglas Day20-Jan-09 11:55 
GeneralRe: Why? Pin
Phil.Benson20-Jan-09 11:58
professionalPhil.Benson20-Jan-09 11:58 

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.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web06 | 2.8.181215.1 | Last Updated 31 Dec 2007
Article Copyright 2007 by Douglas Day
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid