|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
IntroductionIn 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. BackgroundThe 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:
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. PreparationFirst, download the most recent binary version of DDay.Update from SourceForge.net. 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 updatedCreate 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 applicationWe 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".
Then, click on the "Publish" tab on the left, and click the "Publish Wizard" button:
Then, follow the steps of the wizard. Here's what I did:
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 applicationDDay.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: C:\Deployment\DDay.Update.Test\AutoUpdatingApplication.application
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:
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:
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:
Notice the folder named "1.0.0.0". That's where your "real" application is stored. Congratulations, you've setup your application to automatically update! Step 4 - Test it outTo 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:
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:
Notice the new "1.0.0.1" folder. The new version of the application has been placed here. Note: If you chose "Upgrade Later", version 1.0.0.0 will be run, and no updating will occur. That's it!Your application is now automatic-update-enabled. Important informationWhen 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 interestDDay.Update is in mid Beta testing. If you see anything strange or unexplained, please let me know by submitting a bug report here. History
|
||||||||||||||||||||||