AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Checking for updates

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
aik
Guest





PostPosted: Fri Sep 02, 2005 1:56 pm    Post subject: Checking for updates Reply with quote

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?
Back to top
Litmus Red



Joined: 25 Jul 2005
Posts: 139
Location: Richmond, Virginia

PostPosted: Fri Sep 02, 2005 5:15 pm    Post subject: Reply with quote

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%
Back to top
View user's profile Send private message
Guest






PostPosted: Fri Sep 02, 2005 5:56 pm    Post subject: Reply with quote

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 Sad)
Back to top
Guest






PostPosted: Fri Sep 02, 2005 6:00 pm    Post subject: Reply with quote

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



Joined: 06 Nov 2004
Posts: 178
Location: Salt Lake City, UT

PostPosted: Fri Sep 02, 2005 7:45 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group