Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

evenmoremac

macrumors newbie
Original poster
Feb 25, 2008
4
0
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!!!
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
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).
 

cMacSW

macrumors regular
Mar 20, 2006
180
0
Look at the sparkle framework that Catfish_Man linked, this is the way most apps do it.
 

HiRez

macrumors 603
Jan 6, 2004
6,265
2,630
Western US
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.