Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

AHK Automated Installation


  • Please log in to reply
66 replies to this topic
Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
The following script:
- Checks the latest version of ahk installation from web
- Let you select web or local ahk installation file
- Shows download progress while file is being downloaded.
- Backs up registry entries for Compiler/Editor etc. of AHK scripts
- Exits all running uncompiled ahk scripts (asks you to confirm this step)
- Runs installation and automates the process
- Loads back old registry settings
- Runs the scripts exited during installation and upto 3 custom files as per user reqmt (can be your 24*7 scripts or anything else)

IMPORTANT : Compile this script before running.


Script

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


BoBo
  • Guests
  • Last active:
  • Joined: --
Cool!
Thx.
:D

Additional keywords: unattended, setup, silent, update

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Looks great, thanks.

I don't know how you'd feel about adding an optional "check version" mode (maybe it should be a separate script that works in tandem with the above). Such a mode could do steps like these:

1) URLDownloadToFile on http://www.autohotkey.com/download/
2) Extract date from page.
3) Compare date to file date of AutoHotkey.exe
4) If an update is needed, download the generically named installer, which is always at http://www.autohotke... ... nstall.exe and is always the latest verison.
5) Optionally prompt user whether to install it.

Just an idea, and hopefully it will become partially built-in someday anyway.

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
nice ideas Chris... want me to put them in?... should be easy.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
i was checking the source of the d/l page and noticed that the time of update isn't available in a very ahk-friendly format... would b better if u could provide that in a better format... even if its hidden to a page visitor.

and is there a sure-as-hell way to tackle the issue of difference in time-zones?

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


BoBo
  • Guests
  • Last active:
  • Joined: --
That's what I've got so far ...

WgetPath = C:\Download\Software\AutoHotkey\Extras
SOURCEPath = http://home.tampabay.rr.com/kodi/ahk/
DESTPath = C:/Download/Software/AutoHotkey/Archive/
LogFile = AHKAutoUpdate.log

; get name of saved installer e.g. AutoHotkey1024.exe
Loop, %DESTPath%/AutoHotkey*.exe
	{
	FileName = %A_LoopFileName%
	}

; get release number from filename = 1024
StringReplace, Filename, Filename, AutoHotkey
StringTrimRight, FileNum, Filename, 4

ToolTip, Checking for AHK-Update.
SetTimer, RemoveToolTip, 3000

; connect to download area
CheckFileStatus:
RunWait, %COMSPEC% /C wget.exe -N "%SOURCEPath%AutoHotkey%FileNum%.exe" -P "%DESTPath%" -A AutoHotkey[0-9999].exe -o %LogFile% -v, %WgetPath%\wget, Min

; check response from server by parsing the log
Loop, Read, %WgetPath%\wget\%LogFile%
	{
	If A_LoopReadLine contains -- not retrieving. ; No update found for current rel, checking for new release
			{
			FileNum += 1
			Goto, CheckFileStatus
			}
	If A_LoopReadLine contains ERROR 404
			{
			ToolTip, No AHK-Update available.
			SetTimer, RemoveToolTip, 3000
			ExitApp
			}
	If A_LoopReadLine contains saved
			{
			ToolTip, AHK-Update delivered !
			SetTimer, RemoveToolTip, 3000
			ExitApp
			}
	}


RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return

BTW: requires wget. 8)
Tweaking would be much appreciated, especially if you can figure out how to use the --spider parameter of wget. Good luck. :)

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
Thanx BoBo! thats a nice script!
is there some util u can think of that can get properties of a remote file?

and maybe Chris missed my post..

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


BoBo
  • Guests
  • Last active:
  • Joined: --

that can get properties of a remote file

Which ? Why ?

When running Wget with -N the decision as to whether or not to download a newer copy of a file depends on the local and remote timestamp and size of the file (see Time-Stamping.).

BoBo
  • Guests
  • Last active:
  • Joined: --

i was checking the source of the d/l page and noticed that the time of update isn't available in a very ahk-friendly format... would b better if u could provide that in a better format... even if its hidden to a page visitor.

Well, nothing new to me ---> [a previous post] :roll:

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004

When running Wget with -N the decision as to whether or not to download a newer copy of a file depends on the local and remote timestamp and size of the file (see Time-Stamping.).

oh i din't know abt that... thanx!

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


BoBo
  • Guests
  • Last active:
  • Joined: --
Currently I'll find that to check/compare for an update:
1) [AutoHotkeyInstall.exe] = generically named | Download
2) [AutoHotkey1025.exe] = version named/mirrored | Download
3) AutoHotkey.exe | Installed

What makes sense? To compare :
1 against 3
1 against 2
2 against an archived copy of 2
2 against 3

:?:

Question: what will be done by the installer ?
create folder(s)
copy files
write reg entries
... ?

If an uncompiled (zipped) archive of an AHK release could be provided (beside an user friendly installer exe) an unattended update/replacement wouldn't be a big thing.

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

i was checking the source of the d/l page and noticed that the time of update isn't available in a very ahk-friendly format...

I'll look into that. Perhaps it would be better to have a separate text file on the site containing only the version number and modification date. That one file could be downloaded and easily parsed.

and is there a sure-as-hell way to tackle the issue of difference in time-zones?

Perhaps using GMT would be best.

If an uncompiled (zipped) archive of an AHK release could be provided (beside an user friendly installer exe) an unattended update/replacement wouldn't be a big thing.

Others have asked for this so I'll try to make it available soon.

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004

Perhaps it would be better to have a separate text file on the site containing only the version number and modification date. That one file could be downloaded and easily parsed.

couldn't be better!

uncompiled (zipped) archive of an AHK release

would also be helpful for us guyz with bandwidth problems..

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
However, to avoid the need to have unzip capability on the machine where the script runs, perhaps a self-extracting archive is best. As an added benefit, such an archive would probably be smaller in size than a zip file.

Does anyone know of a free (preferably open source) self-extracting archive maker that gives good compression? Maybe 7-Zip is best?

Edit: I was wrong about the zip file version being larger. It's actually about the same size as the installer.

jonny
  • Members
  • 2951 posts
  • Last active: Feb 24 2008 04:22 AM
  • Joined: 13 Nov 2004
I haven't actually tried it yet, but SFX Maker was recommended to me. I'll be using it for any future distributed scripts/programs, unless I encounter problems with it.