Jump to content


Checking for updates


  • Please log in to reply
4 replies to this topic

#1 aik

aik
  • Guests

Posted 02 September 2005 - 12:56 PM

Having problems with a msgbox that is supposed to come up when theres a new update available.

IfExist, version.txt
FileDelete, version.txt
URLDownloadToFile, http://www.aikscroll.reality-shock.com/version.txt, version.txt
thisversion = 6.2
FileRead, mostrecentversion, version.txt
  If mostrecentversion not in %version%
    Msgbox, 1, Update Available, A new version is available. Press 'OK' to download it. Otherwise, cancel.
      IfMsgbox, OK
        {

          FileSelectFolder, zip ,, 3, Save the .zip file to...? You should unzip this right over your existing AiK Macros folder.
          URLDownloadToFile, http://aikscroll.reality-shock.com/aikmacros.zip, %zip%\aikmacros.zip
            return
        }
return

I get the msgbox now matter what the file reads. What could be wriong?

#2 Litmus Red

Litmus Red
  • Members
  • 139 posts

Posted 02 September 2005 - 04:15 PM

The following line doesn't look right to me.

If mostrecentversion not in %version%
I think it should be something like ...

If thisversion not in %mostrecentversion%


#3 Guests

  • Guests

Posted 02 September 2005 - 04:56 PM

hmmm... I'll see if that works when I get home. I also tried:

If mostrecentversion = NOT %version%

P.S. looking back I realize I also used the wrong var (version instead of thisversion :()

#4 Guests

  • Guests

Posted 02 September 2005 - 05:00 PM

forgot to meantion ^--- that didnt work. wouldve edit my post but im not logged in

#5 ranomore

ranomore
  • Members
  • 171 posts

Posted 02 September 2005 - 06:45 PM

It seems easier to me to just read line 1 of the file (that way you don't have to deal with any accidental linefeeds):
FileDelete, version.txt
URLDownloadToFile, http://www.aikscroll.reality-shock.com/version.txt, version.txt
thisversion = 6.2
FileReadLine, mostrecentversion, version.txt, 1
If mostrecentversion > %thisversion%
{
	Msgbox, 1, Update Available, A new version is available. Press 'OK' to download it. Otherwise, cancel.
	IfMsgbox, OK
	{
		FileSelectFolder, zip ,, 3, Save the .zip file to...? You should unzip this right over your existing AiK Macros folder.
		URLDownloadToFile, http://aikscroll.reality-shock.com/aikmacros.zip, %zip%\aikmacros.zip
	}
}
return