Shoutbox

Is there a way for me to check for updates? - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Is there a way for me to check for updates? (/showthread.php?tid=74194)

Is there a way for me to check for updates? by Jacen on 05-05-2007 at 10:17 PM

I'm just wondering if theres an easy way for my script to check for updates to itself?


RE: Is there a way for me to check for updates? by deAd on 05-05-2007 at 10:54 PM

Sure, have your script use the Microsoft.XMLHTTP activex object to connect to the internet and download a page or file that contains update information (an XML file works nicely, but other things will work too).

Here's an example of downloading a web page with XMLHTTP:
http://shoutbox.menthix.net/showthread.php?tid=56...d=617138#pid617138

You can also look at the source of any existing script that checks updates ;)


RE: Is there a way for me to check for updates? by Jacen on 05-06-2007 at 12:55 AM

So, to get the updated version I should do this

replace
Debug.Trace(xmlhttp.responseText);

with
version = xmlhttp.responseText;? I have a text file thats on my site that the only content in the file is the version number so... Would that place the version number into a varable where I can then use a IF statement to check?


RE: Is there a way for me to check for updates? by Jacen on 05-06-2007 at 04:50 PM

Don't know what the forum rules about bumping are, but I need an answer :)


RE: Is there a way for me to check for updates? by joey on 05-06-2007 at 05:35 PM

the rules are "dont bump or you die.(in a very serious tone.)"

and why not just try it, see if it works, whats the worsta that can happen?


RE: Is there a way for me to check for updates? by CookieRevised on 05-06-2007 at 08:34 PM

quote:
Originally posted by Jacen
Don't know what the forum rules about bumping are, but I need an answer :)
Bumping is only allowed after a few days

quote:
Originally posted by Jacen
So, to get the updated version I should do this

replace
Debug.Trace(xmlhttp.responseText);

with
version = xmlhttp.responseText;? I have a text file thats on my site that the only content in the file is the version number so... Would that place the version number into a varable where I can then use a IF statement to check?
yes that will work, but note that the variable version will be a string, not a number. So be carefull when you use comparisson operators. See the next links for more info on that:
CookieRevised's reply to Script about lock messenger
CookieRevised's reply to Nudges, Updated.

Also note that this whole routine is not instant; it runs asyncronically. Thus it can be a while (as in seconds) before anything is returned. So you also better include a time-out meganism.

Complete examples can be found in several scripts. I suggest you take a look at the bundled scripts which comes with the newest Messenger Plus! Live. For example the Now Playing script.