Search

 

March 2007
S M T W T F S
« Feb   Apr »
 123
45678910
11121314151617
18192021222324
25262728293031

Tags

Archives


« | Main | »

Apollo Self Updating Applications

By Rich Tretola | March 20, 2007
14,623 views

One of the beauties of Apollo is the ability of the application to update itself whenever necessary. Those of us who are used to the client/server metaphor have never had to worry about this because if we found a bug in our code (yeah right), we could simply update the server and it is like it never even happened. However, now that we are offering our applications for download, we lose a certain piece of control. Unless, we build in a method for our applications to update themselves when necessary.

This example shows one method for doing this. Here is how it works.

Here are some screen shots and links to download the outdated version of the application and source code.

Version .3 loads:

selfupdating1.jpg

User clicks “Check for Update”

selfupdating2.jpg

After choosing “Yes” new version downloads and installs (Wow what an upgrade!!)

selfupdating3.jpg

Finally, the user clicks “Check for Updates” again

selfupdating4.jpg

NOTE: Please do not run this over and over again or you will suck up all of my bandwidth. You can easily replicate this on your own servers. :-)

Also, this application puts the control in the users hands, but you can also do all of this automatically by checking the version on creationComplete and then installing the new version automatically without user interaction.

Download the Application

Download the Source Code

Topics: Adobe AIR, Tutorials | 17 Comments »

17 Responses to “Apollo Self Updating Applications”

  1. Alex MacCaw Says:
    March 20th, 2007 at 12:14 pm

    I’ve got a solution similar to this, but I’ve also integrated online/offline notification in to this. When the app pings my server to check if it’s online/offline, it also checks the version and updates if necessary.

    Reply to this comment

  2. everythingflex Says:
    March 20th, 2007 at 12:25 pm

    Very cool.

    Thanks for your comments.

    Reply to this comment

  3. Nick Says:
    March 21st, 2007 at 6:59 pm

    Very cool indeed!

    One caveat though – if you move the application from the default installation folder (~/Applications on Mac OS X) into another folder the update will fail. The updated application will be installed in the default location, and the “old” application will then be relaunched – making it appear that it hasn’t updated at all – and leaving you with two different versions of the same application in two different locations!

    Reply to this comment

  4. Dusty Says:
    April 22nd, 2007 at 9:06 pm

    Hey, the download links aren’t working, I was really looking forward to seeing the code for this, :-(

    Please send me an email if you fix it!

    Reply to this comment

  5. Dusty Says:
    April 22nd, 2007 at 9:08 pm

    The link has bad case, it links to “Apollo”, when it should be “apollo”

    Thanks!

    Reply to this comment

  6. everythingflex Says:
    April 22nd, 2007 at 10:12 pm

    Sorry, I recently switched to a Linux box. It is fixed now.

    Reply to this comment

  7. Andrew Wooldridge Says:
    June 15th, 2007 at 2:12 pm

    It would be really awesome if there was an example of a self-updating HTML based AIR app? I’m building AIR apps using HTML/JS and would really like to take advantage of the same update feature.

    Reply to this comment

  8. Alex Brofsky Says:
    July 14th, 2007 at 3:55 am

    Might you be updating your source code for the AIR beta? I try including your source code in my app and when I try & run it in Flex 3 Beta, I get an error of this:

    1136: Incorrect number of arguments. Expected 2.

    It’s talking about the last line in this section:

    // Handle CLOSE Event when file write has completed and call update to update application install
    private function fileClosed(event:Event):void {
    var updater:Updater = new Updater();
    var airFile:File = File.desktopDirectory.resolve(this.latestFileName);
    The line causing the error –> updater.update(airFile);

    If you could at least suggest to me how to fix it, that be awesome as I could really use this in my app.

    Reply to this comment

  9. everythingflex Says:
    July 14th, 2007 at 7:28 am

    I will when I get a chance. In the mean time you can check out this site:
    http://merhl.com/?p=32

    Reply to this comment

  10. Ashish Jha Says:
    October 6th, 2007 at 3:33 am

    Thanks for the article.I just got an idea of using this feature for my applications.There are many things which should be taken care of before updating an application.
    thanks,it looks every body is now thinking for self updating application.

    Reply to this comment

  11. everythingflex Says:
    October 6th, 2007 at 6:59 am

    Take a look at my newer version at:
    http://blog.everythingflex.com/2007/10/01/air-update-manager/

    Reply to this comment

  12. 小小菜鸟 Says:
    April 28th, 2008 at 7:42 am

    cann’t use for 1.1

    Reply to this comment

  13. everythingflex Says:
    April 28th, 2008 at 8:41 am

    No, this was Apollo code. Check here for AIR code:
    http://blog.everythingflex.com/air-central/everythingflexair1swc/updatemanager/

    Reply to this comment

  14. 小小菜鸟 Says:
    April 28th, 2008 at 9:18 am

    hello everythingflex~

    think u for your answer.

    when i use your swc,
    there is a error:
    1120: 访问的属性 um 未定义。

    so bizarrerie~~

    my code:

    import com.everythingflex.air.managers.UpdateManager;
    private var um:UpdateManager = new UpdateManager(“http://……./prototype/version.xml”,true);
    um.currentVersion=”.2″;

    Reply to this comment

  15. 小小菜鸟 Says:
    April 28th, 2008 at 9:28 am

    if i don’t use the currentVersion property,
    it can check & download the new version,
    but when installing, a error occur:
    This application cannot be installed because this installer has been mis-configured. Please contact the application author for assistance.

    Reply to this comment

  16. wDNICI Says:
    January 2nd, 2010 at 9:48 pm

    You are manifestly, a real master of thesis summary just about this good topic accomplishing but when you like to select the thesis, I would propose you to coose the best item.

    Reply to this comment

  17. ahsan Says:
    March 13th, 2010 at 10:10 am

    i,m facing this problem”This application cannot be installed because this installer has been mis-configured. Please contact the application author for assistance” while downloading and installing new version over privious.

    .

    plz any one have any solution.

    Reply to this comment

Comments