Announcement

Collapse
No announcement yet.

Self updating Applications

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Self updating Applications

    I am planning on making an application that downloads new updates as they become available. From experience what have people encountered when creating self updating applications.

    Before people get up-in-arms, there will be a auto-update question during the install. Clients will have the choice to not enable it, but if it is enabled I am looking at what pitfalls people have seen.

    Firewall issues will be address separately I am just concerned with the basic process.

    Some questions I can think of...
    1. Where do you download these files to first?
    2. Do you copy the files from the download location to "%program files%\My Application Dir" or run them from the download location (except for %temp%)?
    3. Does Windows balk at this process (Windows itself, not concerned with Virus/spyware protection at this stage).
    4. Success stories/Horror stories?
    Last edited by George Bleck; 4 Feb 2008, 01:59 PM.
    <b>George W. Bleck</b>
    <img src='http://www.blecktech.com/myemail.gif'>

  • #2
    Originally posted by George Bleck View Post
    1. Where do you download these files to first?
    Depends on the operating system, in windows vista you will
    need to pick the location carefully, in Windows XP and lower
    you can download it to anywhere, i.e. a Temp Folder.

    Originally posted by George Bleck View Post
    1. Do you copy the files from the download location to "%program files%\My Application Dir" or run them from the download location (except for %temp%)?
    I would have my exe run a separate Exe, the updater, then if the updater detects new updates, it would send a command to the main program to be
    closed, rewrite the exe (or dlls, scripts or whatever you update), and then re-open the main exe, and then close the updater.

    Originally posted by George Bleck View Post
    1. Does Windows balk at this process (Windows itself, not concerned with Virus/spyware protection at this stage).
    I never got it complaining.

    Originally posted by George Bleck View Post
    1. Success stories/Horror stories?
    This method has worked very well for me, the only pitfall is when you
    try to update the updater, but thats nothing you cant figure out. It sould
    be easy.

    Comment


    • #3
      How you want to do it may depend if you are updating executable files (*.Exe, *.dll) or program data files, help files, etc.
      Michael Mattias
      Tal Systems (retired)
      Port Washington WI USA
      [email protected]
      http://www.talsystems.com

      Comment


      • #4
        Some changes could be in an application configured INI. This INI is used by the application to store settings as it runs, but it isn't a user configurable INI in the normal sense.

        Most changes would be in DLL's as I make changes to calculation tables and new functionality if it gets introduced.
        Last edited by George Bleck; 4 Feb 2008, 03:59 PM.
        <b>George W. Bleck</b>
        <img src='http://www.blecktech.com/myemail.gif'>

        Comment


        • #5
          I have this built in to my freeware apps, basically I do this:
          1. Check server list file for version/date info
          2. If server has new files, download the files and the update program to a temp folder.
          3. Shell to the update program and exit the main app (and close all other instances of it).
          4. Update program performs necessary tasks, updating DLLs, data files, etc. all files are deleted after being moved.
          5. Update program re-runs main app, which should be the new version.
          Step 3 is most important as the main app could potentially have several instances, which must all be closed first. You could get around this in step 4 by using MoveFileEx with the MOVEFILE_DELAY_UNTIL_REBOOT flag and request the user reboots, but I prefer not to do that.

          I don't have the update checks set to auto as I don't know what pressure that would put on my site's server with all the (potentially) thousands of users, so I have a "check for updates" option in the help menu.

          Vista creates a problem as the update prog must have admin privileges. I haven't got to that part yet as my % of Vista users are still small (less than 5%)
          kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

          Comment


          • #6
            Originally posted by George Bleck View Post

            Firewall issues will be address separately I am just concerned with the basic process.

            Some questions I can think of...
            1. Where do you download these files to first?
            2. Do you copy the files from the download location to "%program files%\My Application Dir" or run them from the download location (except for %temp%)?
            3. Does Windows balk at this process (Windows itself, not concerned with Virus/spyware protection at this stage).
            4. Success stories/Horror stories?

            Option 1
            I'd have a updater app that would check a website for updated version compared to the current version. If update, download the files then shell to the application.exe. If no update, just shell to the application.exe. You might want to backup the files that are being replaced.

            Option 2
            Application.exe starts. Checks the web site for an update. Alert the user that an update is available ask if they wish to get it. Open the default web browser to the download page. Let the user download the update and installs it manually.

            %program files%\my application dir on Vista will require admin rights to modify the directory. (not confirmed, but it's what I understand)

            I like option 2 myself. I have a directory on my computer called installs. I create subdirectories by company name and the installs for all the software I own. Option 2 allows me to save the latest version (full, or patch) to this directory structure. Then perform the installation myself. I can perform a backup before I do the installation.

            Of course, I am a developer. A non-tech user would probably like an automatic update.

            Comment


            • #7
              >Alert the user that an update is available ask if they wish to get it

              Do not do as WinSqlPro does at this point, which is to provide *only* an "OK" button, forcing you to go to the web site even if "now is not a good time."

              Personally, I always liked the apps that give me a "remind me later" option, with a choice of time increments. Now here you do not do what the latest version of McAfee does, which is let you select from 4 hours, tomorrow, or one week, then ignores your choice and reminds you again in the default 4 hours.

              (Both were so close yet so far to being right!)

              MCM
              Michael Mattias
              Tal Systems (retired)
              Port Washington WI USA
              [email protected]
              http://www.talsystems.com

              Comment

              Working...
              X