AutoHotkey Community

It is currently May 27th, 2012, 12:21 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Checking for updates
PostPosted: September 2nd, 2005, 1:56 pm 
Having problems with a msgbox that is supposed to come up when theres a new update available.

Code:
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?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 2nd, 2005, 5:15 pm 
Offline

Joined: July 25th, 2005, 10:20 pm
Posts: 139
Location: Richmond, Virginia
The following line doesn't look right to me.

Code:
If mostrecentversion not in %version%

I think it should be something like ...

Code:
If thisversion not in %mostrecentversion%


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 2nd, 2005, 5:56 pm 
hmmm... I'll see if that works when I get home. I also tried:

Code:
If mostrecentversion = NOT %version%


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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 2nd, 2005, 6:00 pm 
forgot to meantion ^--- that didnt work. wouldve edit my post but im not logged in


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 2nd, 2005, 7:45 pm 
Offline

Joined: November 6th, 2004, 11:03 am
Posts: 170
Location: Salt Lake City, UT
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):
Code:
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


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Leef_me, Pulover, rjgatito, XstatyK, Yahoo [Bot] and 22 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group