mIRC Homepage
Posted By: DarkBoi An update checker - 26/03/07 04:00 PM
Hey what I'm trying to do is get a script that i'm in the process of making to check back to a main location and make sure it has the newest script, if it does it just continues if it doesn't it downloads the new script and reloads the script to the newest version. Can this be done? can someone point me in the right direction with this?
Posted By: xDaeMoN Re: An update checker - 26/03/07 05:07 PM
You will need to use sockets. If you're not familiar with it, google & read some tutorials about them. You can also look at some mIRC update checker snippet/scripts & see how they did it so you may have an idea.
Posted By: DJ_Sol Re: An update checker - 26/03/07 05:34 PM
I'll give you the basic idea behind mine.

I have a text file on my server that has each file name and its version number.
When I check for updates I check this file for the versions that are on the script. If any version number is greater or there is something on the server that isnt on my script it says there is an update available.

When you download, I read those .mrc files and overwrite the files in my script. Starting by write -c the file in my script.

This means I need to manually keep that text file on my server up to date. Then in each script.

on *:unload:/remini mirc.ini version $nopath($script)
on *:start:/writeini mirc.ini version $nopath($script) 1

This is where the version information is kept. This shows version 1.
Posted By: xDaeMoN Re: An update checker - 26/03/07 06:20 PM
I think this reply is for Darkboi. wink
Posted By: Riamus2 Re: An update checker - 26/03/07 09:51 PM
Most of my distributed scripts have an updater. I just have it check the download location for the version number (my pages for each script mention the version number). However, none of my scripts will automatically download/"install" updates. I've always felt that although doing so is easier, it feels to me like I'm forcing it on people. Some people don't want to update, or else don't like the idea of a script doing it automatically without their approval. If you want it to do an automatic update, then you would need to download the script and reload it.

There are various socket script examples on the forum. Do a search in this forum for sockopen and you should find some good examples.
Posted By: DJ_Sol Re: An update checker - 27/03/07 05:42 AM
I offer a dialog that shows you the files available to update and they can select which files they want to update and click update.

xDaemon, I think he can figure it out.
Posted By: Riamus2 Re: An update checker - 27/03/07 01:15 PM
Ok. smile

It looked like it did it all automatically, which is why I commented (plus, it was also in response to the OP's request).
© mIRC Discussion Forums