checking for version updates?

Discussion in 'Mac Programming' started by evenmoremac, Aug 10, 2008.

  1. evenmoremac macrumors newbie

    Joined:
    Feb 25, 2008
    #1
    Hey guys,
    i waz wondering how you can make something check for updates, and if there is an update for it to download it? specifically on a dashboard widget.


    THANK YOU THANK YOU THANK YOU!!!
     
  2. Catfish_Man macrumors 68030

    Catfish_Man

    Joined:
    Sep 13, 2001
    Location:
    Portland, OR
    #2
    For a dashboard widget you'd probably have to write your own custom updater. For most other things, Sparkle (http://sparkle.andymatuschak.org/) is the way to go.
     
  3. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #3
    I don't think it'd be too difficult to write using AJAX. Just have a webpage that returns the latest version of your widget, and write an AJAX function to fetch this and compare it to the widget's version (which could simply be a static string somewhere in the JavaScript).
     
  4. evenmoremac thread starter macrumors newbie

    Joined:
    Feb 25, 2008
  5. cMacSW macrumors regular

    Joined:
    Mar 20, 2006
    #5
    Look at the sparkle framework that Catfish_Man linked, this is the way most apps do it.
     
  6. Catfish_Man macrumors 68030

    Catfish_Man

    Joined:
    Sep 13, 2001
    Location:
    Portland, OR
    #6
    He's making a dashboard widget, not an app.
     
  7. cMacSW macrumors regular

    Joined:
    Mar 20, 2006
    #7
    Missed that.:(
     
  8. HiRez macrumors 603

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #8
    To expand on what kainjow said, the version could just be the version number (which you must remember to update with each release) as plain text stored in a file on a server ("2.1.2"). You load the file url into a string and compare it to a string of the running version built into your widget (which you also must remember to update with each release). If the version of the file is greater than the running version, you pop up an alert and redirect the user to the download url. Don't forget to add error checking code that makes sure your app doesn't do something bad if they don't happen to be connected to the internet.
     

Share This Page