(Lviv community of .NET developers)

Auto Update Application Block

January 8, 2008 10:33 by alexk

I start my day from reading articles on CodeProject.com and found very interesting one: http://www.codeproject.com/KB/install/DDayUpdate_Part1.aspx

It's based on ClickOne technology and provide easy way to update own applications. Do you want to know how to implement something like ClickOnce Auto Update by own hands? I'm sure you want...


I name this article "Auto Update Application Block", so I hope this will not confuse anyone.

Auto Update Application Block

First, let's start from the diagrams:

Application start will look something like that:

Introduction

Application block does not have on current moment full implementation, but several parts of it already implemented and successfully used in internal projetcs. This article mostly describe concept of Auto Update block for minimizing time required for design and implementation by other developers.

Architecure

USE CASE: How to use application block in application by developers

  1. Attach into solution ArtfulBits.AutoUpdate project;
  2. result of the project embed as a resource into result application;
  3. attach into application our helper class (as additional assembly or as source file);
  4. add into startup application point (source code) execution of our autoupdate check;


As a result auto update block attached to a application in 5 minutes without any additional programming.

Analysis of USE CASES (not only one written upper) - Feature List:

  1. Auto Update have to start as a stand alone process, otherwise replacement of the original application executables not possible;
  2. Auto Update have to work with http and file URIs;
  3. Auto Update have to allow run custom actions before and after files updates, that allowing to create advance automatic updates scenarios;
  4. Auto Update can be started as a background process;
  5. Auto Update block must allow self update;

Update Application Parameters

  1. PID - process ID of application exit of which we have to wait before installing updates;
  2. URL - url to the server where hosted updates;
  3. PROXY - proxy configuration; (OPTIONAL)

Algorithm of work

  1. try to reach by specified by user URL xml file with update information:
    1. validate XML before processing;
    2. update information can be a part of bigger XML document with another hierarchy;
    3. folders structure of files - PATH INFORMATION;
  2. Extract version information from XML;
  3. Check current version information of application:
    1. extract version information from assemblies metadata;
    2. user provide us required information:
      1. in XML format;
      2. in event based model (custom user code);
    3. Compare current and extracted version information:
      1. if version greater current - DOWNLOAD;
      2. if version less then current - IGNORE;
      3. if version not defined - ALWAYS DOWNLOAD/UPDATE:
      4. if version -1 - CHECK ONLY FILE EXISTENCE AND SIZE;
    4. List of files for updating put into DOWNLOAD QUEUE:
      1. Show user Dialog with progress;
      2. Provide events that control download progress;
      3. All files we download into temporary folder;
    5. Run UPGRADE of files:
      1. Copy all old files into backup dir;
      2. Run uninstall actions:
        1. defined in XML;
        2. defined by user in Runtime;
      3. Replace old files by new one;
      4. Run custom install actions (only after we copy all files):
        1. GAC, NGEN, COM, WinService, CMD EXEC;
        2. provide interface for applying custom user actions;

 

 

Example of XML auto update file:

<root version="1.0.0.0">  
  <file name="tracker.dll" gac="yes|no" ngen="yes|no" com="yes|no" winservice="yes|no">
    <path>...destination path... %WINDIR%\folder</path> 
    <size>10345</size> 
    <version>1.0.0.0</version> 
    <description>some text here</description> 
  </file> 
</root>

Currently rated 4.2 by 6 people

  • Currently 4.166667/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Comments

April 15. 2010 18:21

hence all these comments!

jowik

April 18. 2010 19:07

deals with well with people stepping out of line is an attractive thing to readers. I personally don�t mind people express

propecia

April 18. 2010 19:08

good one site luv that stuff

propecia

April 19. 2010 15:02

hey how did you find this theme ?

purchase tramadol

April 26. 2010 16:18

gertgret ret ert ert ert et

Kimberly Mischke

May 26. 2010 15:08

i have been followjng all teh posts on this site through an rss feed and it has been going very well

mens health and issues

June 21. 2010 10:50

I am not sure if I agree with your post here. See you do make the best point, I don’t think you have actually given a large amount of thought to the opposite side of the argument. Perhaps I could do a guest post or a follow-up, just tell me.

Dudy Adityawan

July 7. 2010 12:40

A different excellent post, normally awesome to examine a great post on the topic you truly care about.

Charlie

July 7. 2010 12:40

Must disagree with the comment above, get your facts straight previous to writting such a comment.

Peex

July 7. 2010 23:43

Yet another great post, generally cool to go through an excellent post over a topic you in reality care about.

Peen

July 7. 2010 23:44

Ought to disagree with the comment above, get your facts straight just before writting such a comment.

Mindy Pee

July 10. 2010 19:44

Trubloods.com will be really the web site dedicated to giving you all the goodness and also night of the particular struck show True Blood. True Blood is actually named as the actual manufactured blood vessels the japoneses have got designed and now vampires of the particular underworld arise from the particular darkness in order to attempt as well since exist together together with persons. An individual follow Sookie Stackhouse since your woman deals with the particular chaos which exists on earth. There's ambiance, comedy, action, as well as several a good deal extra whilst a person watch vampires associated with the underworld, humans and also supernaturals conflict within the town regarding Bon Temperatures, Louisiana. Monitor zero cost of charge channels from trubloods.com!

sookie stackhouse

July 15. 2010 02:06

hey how did you find this theme ?

vibram fivefingers

July 16. 2010 17:18

Thank you for this page. Thats all I can say. You most definitely have made this blog into something speciel. You clearly know what you are doing, youve covered so many bases.thanks

Tristan Strand

July 17. 2010 16:31

Hey, always great to see other people from the hole world in my searching, I definitely appreciate the time it should have taken to place together this great website. friendly regards

girl piss in pants

Add comment


(Will show your Gravatar icon)