ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Using AutoHotkey to auto-download and update programs

(1/2) > >>

zridling:
noutters over in the XYplorer Forum posted this cool AutoHotkey script. Modify it to suit your own upgrade needs!
________________________________________________
This AutoHotkey script will download the lastest beta of XYplorer and upgrade it on your machine. Enjoy!

;-------------------Start of script-------------------------
#SingleInstance,Force
#Persistent
SetBatchLines,-1

UrlDownloadToFile, http://www.xyplorer.com/download/xyplorer_5.80_beta_noinstall.zip, c:\temp.zip
MsgBox,1,,Kill XYplorer process and upgrade?
IfMsgBox,Cancel
Return
IfWinExist, XYplorer
WinKill

; The following line should be changed according to the program you use to unzip your files
RunWait, E:\_Utilities\7za.exe e -y -o"C:\Program Files\XYplorer\" c:\temp.zip
;Uncomment and change the path of UPX if you want to compress the files in the XYplorer directory
;RunWait, c:\upx.exe -9 -f *.*,C:\Program Files\XYplorer

FileDelete, c:\temp.zip
run, C:\Program Files\XYplorer\XYplorer.exe
ExitApp

Return
;-------------------End of script-------------------------

justice:
I made a similar script myself for other uses. The only problem with using it more generally is that you have to know the url of the download.

I have always wondered why more software authors don't make their latest release version availalbe via a fixed url, for example: http://softwareauthor.com/product/download/latest.php (which would return not a HTML page but the installation package with the right mime type)

This would open the door for many updating utilities.

zridling:
I've never given this any thought until I saw the script. Don Lessau, who is XYplorer's dev, removed the last two numbers on his updates to accommodate users who do this. And it works for him because he's incrementally updating XYplorer throughout the week. So you could download the daily beta or grab it whenever you wanted.

DonL:
I have always wondered why more software authors don't make their latest release version availalbe via a fixed url, for example: http://softwareauthor.com/product/download/latest.php (which would return not a HTML page but the installation package with the right mime type)-justice (April 25, 2007, 08:18 AM)
--- End quote ---
Good idea. Give me a little hint about the necessary php code and I do it. :)

justice:
Wow.  ;DHere are 92 different implementations in PHP. A lot of them are free.

Basically what you do is set up an connection to the download and binary write it to the browser with the right mime type. If you want to understand how it works or create your own implementation I found the following link from about.com


Navigation

[0] Message Index

[#] Next page

Go to full version