Thread: C# manual updates

  1. #1
    Registered User
    Join Date
    Jul 2011
    Posts
    62

    C# manual updates

    Ok, after thoroughly looking in VC#.NET update features, I decided to make it somewhat different:

    -The way I want this to work
    -What I know of this already
    -What I need to know


    The way i want this to work:

    I have a special launcher application, whose job is to update all relevant files, by downloading them synchronously through the web (from my server) and having a progress bar saying how close it is to completion. After completing, a button becomes enabled that allows the user to launch the main application.


    What I know of this already:

    • I know that synchronous file downloading can be achieved with webclient.Downloadfile(string webpath, string destination_path).
    • I have slight ideas at how to make the progress bar work.
    • I know how to make the button enabled and disabled


    What I need to know:

    • How to check for current file versions. (If needed, maybe have a resource file)
      • What methods are MTA (Multiple Thread Application) safe (I want to check for files in different threads to speed up the process)

    Note: This is my first try at an organized question (as my personality is chaotic, LITERALLY first try). Please tell me if having it organized like so is helpful.

  2. #2
    Registered User
    Join Date
    May 2003
    Posts
    1,619
    Overall, you have several options for versioning:

    1. Check a single file (e.g. look at the version # of your executable), and if it's less than the current version, apply patches for each successive version until it's up to date. This is the way many games work. The downside is that you have to sequentially progress through the versions, and if multiple versions update the same file, you may be getting it several times. The benefit is that depending on your patch technology, you may need only to send those portions of the files that changed.

    2. Similar to #1, but have either the client or server calculate a cumulative list of files that have changed between the source and target version and send each in entirety. The downside is that you send entire files, even if there are only partial changes, but the upside is that you can jump many versions in one update, and if you routinely change most/all of a file, this could save bandwidth compared to 1.

    3. If your total installation size is small enough, you can hash each file, compare with the server, and send any that have a hash mismatch. The downside is that you need to hash your entire installation, the benefit is that you can also repair broken files (many games use this along side #1, with #1 being used for most patching, and #3 being used as a repair option)
    You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.

  3. #3
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    My app first runs my update manager exe.

    My update manager checks all files in the working folder (and any other folders it is configured for).

    It collects a list of file names and CRCs.

    Then it checks the (configured) update location and compares the list of file names and CRCs.

    Any files that the CRC does not match are downloaded.
    Any files that exist on the update location, but not the working folders, are downloaded.

    Once the update exe has finished it launches my app.

    Using a CRC (as opposed to a timestamp / version) means I do not run into time zone issues and can roll back to older versions of the code.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  4. #4
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Check out "ClickOnce" Deployment, it seems to provide anything you need for free.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  5. #5
    Registered User
    Join Date
    Jul 2011
    Posts
    62
    So far, I've thought of something similar to the #2 Cat described:

    Have a resource.up file, that contains on each line a string in the format of
    Code:
    file_path|file_version
    and another one that is stored locally.

    If they match, no need to update, if they don't match, update the files who's version did not match.

    After trying a small solution of this type I ran into a problem : seems the URL input was wrong, server returned 404...

    I'm going to be trying to get this working, and hope to hear more suggestions!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. pw updates
    By lruc in forum Windows Programming
    Replies: 2
    Last Post: 08-22-2008, 06:07 PM
  2. MoA Updates
    By harryp in forum C++ Programming
    Replies: 0
    Last Post: 08-31-2002, 10:28 AM
  3. Qt Manual problems
    By rip1968 in forum Linux Programming
    Replies: 0
    Last Post: 08-15-2002, 03:59 PM
  4. C/C++ Manual
    By JonnyHatesJesus in forum C Programming
    Replies: 7
    Last Post: 07-17-2002, 06:12 AM
  5. XP Updates - Don't they just **** you off!
    By Davros in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 05-29-2002, 09:22 PM

Tags for this Thread