Welcome Guest.   Make a donation to an author on the site July 24, 2014, 03:02:37 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2012! Download dozens of custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: DONE: AutoHotkeyUpdateChecker  (Read 4113 times)
brotherS
Master of Good Ideas
Honorary Member
**
Posts: 2,105


To make a difference, be different.

View Profile Give some DonationCredits to this forum member
« on: February 21, 2006, 12:40:40 PM »

Hi,

I was told about a really great idea - a tiny script to automatically check for new versions of AutoHotkey!

From http://s89775182.onlineho...s/forum/viewtopic.php?t=8 :
[copy or print]
;---2005-10-16 garry, check AutoHotKey for new version -------------
F1=%A_ScriptDir%\AHKURL.TXT
A=%A_AHKVERSION%
URLDownloadToFile,http://www.autohotkey.com,%F1%
I=0
Loop
{
        I+=1
        FileReadLine, line, %F1%, %i%
        if ErrorLevel <> 0
        exitApp
   IfInString,line,The latest version is
        {
   stringmid,BA,LINE,25,18
        GOTO A2
        }
}
A2:
FileDelete,%F1%
B1=%BA%
I=0
loop,parse,B1,`
{
   Transform,B2,ASC,%A_LOOPFIELD%
   I+=1
   if B2<46
   GOTO A3
   if B2>57
   GOTO A3
}
A3:
stringmid,B,B1,1,I-1
if A<>%B%
{
msgbox,(Changed) Your existing version is=%A%, Actual version is=%B%
run,http://www.autohotkey.com/download
ExitApp
}
else
{
msgbox,(Equal) Your existing version is=%A%, Actual version is=%B%
MsgBox, 4, , Start AHK Forum?
IfMsgBox,No
return
Else
Run,http://www.autohotkey.com/forum
ExitApp
}
I'm sure someone in here could even optimize that? To maybe let it auto-check at a given interval, add some other stuff, ...?
« Last Edit: March 07, 2006, 01:29:53 AM by brotherS » Logged

Thank you.
brotherS
Master of Good Ideas
Honorary Member
**
Posts: 2,105


To make a difference, be different.

View Profile Give some DonationCredits to this forum member
« Reply #1 on: March 07, 2006, 01:33:41 AM »

new, better version, which checks silently every 8 hours:

[copy or print]
GoSub, AutoExec11

[...]

;2006-03-04
;check for new AutoHotKey version
#Persistent
AutoExec11:
SetTimer, UpdateCheckAHK, 28800000 ; check every 8 hours
return
;
UpdateCheckAHK:
F1=http://www.autohotkey.com/download/CurrentVersion.txt
F2=%A_ScriptDir%\AHKURL.TXT
A =%A_AHKVERSION%

SetTitleMatchMode, 1
If WinExist("AutoHotkey Download")
    TrayTip, AutoHotkey, already open
else
 {
 URLDownloadToFile,%F1%,%F2%
 Splashimage, off
 Filereadline,B,%F2%,1
 if A<>%B%
    {
;    msgbox,(Changed) Your existing version is=%A%, Actual version is=%B%
     Run,IExplore.exe http://www.autohotkey.com/download
    }
  else
    {
    TrayTip, AutoHotkey, no new version available
    }
 }
return
Logged

Thank you.
jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: March 07, 2006, 01:49:26 PM »

Just added it, and it checked for the new version correctlly!
Thanks! cheesy
Logged

lanux128
Global Moderator
*****
Posts: 6,087



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: March 07, 2006, 08:19:34 PM »

brotherS,

i changed the timer to 0 and here is the result... ;-)



best regards,
lanux
Logged

jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: March 07, 2006, 08:44:37 PM »

Lanux: possibly, you already know this, but i'll say it anyways, better be safe than sorry.
Changing that timer to 0 will make the script be always checking for updates (i.e. always downloading the autohotkey.com page.)
Possibly, this will take you much bandwidth, and might not be the solution you were looking for.
To only have it execute once, you should change that timer to:
[copy or print]
GoSub,UpdateCheckAHK,
If you already knew this, sorry, but i supposed it was better to warn you (and other possible readers of this thread)
Logged

lanux128
Global Moderator
*****
Posts: 6,087



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: March 07, 2006, 09:57:47 PM »

jgpaiva: yes, now i know... ;-) tks anyway...
Logged

brotherS
Master of Good Ideas
Honorary Member
**
Posts: 2,105


To make a difference, be different.

View Profile Give some DonationCredits to this forum member
« Reply #6 on: March 08, 2006, 02:48:06 AM »

Hi lanux128, welcome to the amazing world of AutoHotkey!  cheesy
Logged

Thank you.
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.057s | Server load: 0.02 ]