CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2008
    Posts
    24

    Exclamation Auto update of program (Downloading from web)

    Hello.

    I have been creating a application that checks the application version and sees if it fits with the version from http://msbeditor.dumpen.dk/versioninfo.html

    If it doesnt I use a webBrowser component to open a download link to http://msbeditor.dumpen.dk/msbEditor.rar

    But this is not very practical because, the ones using my application have to download all files even though some of the files are not changed..

    So I wanted to ask if you have an idea on how to make a auto updater in C#?

    I was thinking of something like:
    Check the application version with the online version (Allready done)
    If it doesnt fit, then match all the files (last changed or file size or similar) in the rar file (from msbeditor.dumpen.dk) with the files in the application folder
    If they are changed then download the changed files

    Any ideas?

  2. #2
    Join Date
    May 2003
    Location
    Germany
    Posts
    936

    Re: Auto update of program (Downloading from web)

    I think the easiest way is to build a Click Once application. Here is a link to the related documentation. You will find there also a chapter about update strategies.
    Useful or not? Rate my posting. Thanks.

  3. #3
    Join Date
    Sep 2004
    Posts
    1,361

    Re: Auto update of program (Downloading from web)

    I use MD5 keys. I download a text file that contains some XML records of each file. These records tell me what the MD5 hash of each file should be, where the file is stored locally (relative to the install folder) and where to get the correct file if it needs to be updated.

    My update then goes through the list and computes the MD5 hash of the local file and compares it to the given MD5 key from the update file. If there is a mismatch, it adds the file to the download que. If they match, the record is discarded.

    After I download each file I once again check the MD5 hash to make sure it came through without any errors and then proceed to rename / delete files as needed. I also have a post install script which runs depending upon which components need to be updated. IE: The main application might have to exit and reload as a result.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured