Page 1 of 2

Autohotkey script to update automatically your XYplorer beta

Posted: 23 Apr 2007 14:20
by noutters
This Autohotkey script (http://www.autohotkey.com/) will download the lastest beta och XYplorer and upgrade it on your machine.

Enjoy! :)

;-------------------Start of script-------------------------
#SingleInstance,Force
#Persistent
ApplicationTitle=Download XYplorer Beta`nCompile 5/1/2007 11:38AM
SetBatchLines,-1

TrayTip,,Downloading latest XYplorer Beta...
UrlDownloadToFile, http://www.xyplorer.com/latestbeta.php, c:\temp.zip
TrayTip,,Downloading latest XYplorer Beta... DONE!
MsgBox,1,,Close all instances of XYplorer and upgrade?
IfMsgBox,Cancel
{
FileDelete, c:\temp.zip
ExitApp
}

TrayTip,,Closing XYplorer
loop, 10
{
Process,Close,XYplorer.exe
if ErrorLevel
Sleep, 500
else
Continue
}

; The following line should be changed according to the program you use to unzip your files
TrayTip,,Upgrading XYplorer
RunWait, F:\_Utilities\7za.exe e -y -o"C:\Program Files\XYplorer\" c:\temp.zip

FileDelete, c:\temp.zip
TrayTip,,Restarting XYplorer
Run, C:\Program Files\XYplorer\XYplorer.exe
Sleep 1000
TrayTip
ExitApp

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

Posted: 23 Apr 2007 16:16
by lukescammell
Groovy.

Can you add in UPXing it as well, then I'll be very impressed :)

I use the following command to UPX XY:

Code: Select all

upx *.* --brute --nrv2d
Thanks :)

Edit: Thinking ahead, perhaps Don could default to naming the latest beta something like "xyplorer.latest.zip" and "xyplorer.latest.exe"? This way you won't ever have to update that line :)

Added UPX compression in the script

Posted: 23 Apr 2007 20:14
by noutters
Uncomment the line and change the path of UPX if you want to compress the files in the XYplorer directory. This is untested so may be you have to tune it a bit and get the right arguments in place.

Re: Autohotkey script to update automatically your XYplorer

Posted: 23 Apr 2007 20:27
by admin
noutters wrote:This Autohotkey script (http://www.autohotkey.com/) will download the lastest beta och XYplorer and upgrade it on your machine.

Enjoy! :)
Hey, thanks, very nice!! :D

Posted: 23 Apr 2007 20:35
by admin
lukescammell wrote:Edit: Thinking ahead, perhaps Don could default to naming the latest beta something like "xyplorer.latest.zip" and "xyplorer.latest.exe"? This way you won't ever have to update that line :)
In the past I once had a version number in it (TrackerV3_4.00_Install.zip), then took it away (trackerv3_install.zip), then put it back in (XYplorer_4.40_BETA.zip), then made it lower case (xyplorer_5.10_beta.zip) -- and I forgot the reasoning behind those changes and did not make any note about it (had more important things to do...).
There was some discussion about it here, but... damn, is there anybody who knows how you search this forum and find something??? :evil: :wink:

Posted: 23 Apr 2007 21:34
by jacky
admin wrote:There was some discussion about it here, but... damn, is there anybody who knows how you search this forum and find something??? :evil: :wink:
Here's what I found:

This is when you removed the version number:
http://www.xyplorer.com/xyfc/viewtopic.php?p=1918#1918
Which had explanations on why, and triggered some reactions.

Then, when XY came up, the version number was back.
http://www.xyplorer.com/xyfc/viewtopic.php?p=3694#3694
I don't know it there was a discussion behind this or not, though.

And IMO it's best as it is, with the version number in the filename... I understand the "problem" for automatic procedure, but I think it's best to sort things out, and it's not like XY changes version number (on that level) every day :roll:

Posted: 23 Apr 2007 22:36
by admin
jacky wrote:
admin wrote:There was some discussion about it here, but... damn, is there anybody who knows how you search this forum and find something??? :evil: :wink:
Here's what I found:

This is when you removed the version number:
http://www.xyplorer.com/xyfc/viewtopic.php?p=1918#1918
Which had explanations on why, and triggered some reactions.

Then, when XY came up, the version number was back.
http://www.xyplorer.com/xyfc/viewtopic.php?p=3694#3694
I don't know it there was a discussion behind this or not, though.

And IMO it's best as it is, with the version number in the filename... I understand the "problem" for automatic procedure, but I think it's best to sort things out, and it's not like XY changes version number (on that level) every day :roll:
Thanks for looking it up. :)

And yes, I share your opinion.

Posted: 24 Apr 2007 18:16
by avsfan
This looks very nice!

I have a follow-up question on the script, though -- I usually have 2 instances of XY running with different configuration files. The above script will only kill one of them. If I modify the script to repeat the two lines as follows:

IfWinExist, XYplorer
WinKill
IfWinExist, XYplorer
WinKill

the second window still persists and I have to kill it manually.

Is there a way to have it kill *all* XY processes? (or is there another solution?)

Thanks!

andy

Posted: 24 Apr 2007 18:35
by surrender
@ andy,
Just curious. Do you run 2 XYs to mimic dual pane or do you have some other reasons?
and more curious, what is that 2 XYs can do that 1 XY can't?

Posted: 24 Apr 2007 19:39
by avsfan
A fair question. It's basically just a way to have more tabs open without having them super-crowded. I use one for the various directories that I use in my development environment, and one for the assorted other stuff that I do regularly. I could just pick the folders off the tree, but they're not always where I want them, so I prefer to have a tab for each frequently used folder.

(and I occasionally use the two XYs almost like a dual pane -- dragging from one into another -- but not frequently).

Now, I could probably get by with a single XY if it had the "Per-Tab history" that's been discussed before... (after CKS, of course -- but I'd REALLY REALLY love to have each tab have its own history! PLEASE! :) )

Posted: 24 Apr 2007 19:40
by noutters
Is there a way to have it kill *all* XY processes? (or is there another solution?)
You could do a loop from 1 to 100 that includes the kill commands.
I guess you do not run more than 100 instances of XYplorer :wink:

Posted: 24 Apr 2007 19:43
by avsfan
You could do a loop from 1 to 100 that includes the kill commands.
Is that different from the four lines I posted earlier that calls the kill command twice? that method didn't work, and I'm wondering if there's something else that needs to be done to get it to kill both of them...

Any ideas?

andy

Posted: 24 Apr 2007 19:58
by noutters
Ok, I updated the script so it kills now up to 10 instances of XYplorer.

Posted: 24 Apr 2007 20:26
by avsfan
Ah, very nice!

The only problem I see now is that it kills *anything* that starts with XYPlorer, including my AutoHotKey script that I had called "XYPlorerUpdate" and my Firefox window with the active tab using this forum! Not exactly what I was expecting, but at least it was thorough! :)

I renamed the script, so that's not a problem. Is there a way to get it to leave Firefox alone? (or even better yet, just to have it only kill XYPlorer.exe processes?)

Thanks again! I'll have to learn more about AutoHotKey (I'd never heard of it before you posted about it!)

andy

Posted: 24 Apr 2007 20:32
by noutters
Instead of
IfWinNotExist, XYplorer
try
IfWinNotExist, XYplorer @ XYPlorer.ini
or whatever ini file you use. This command identifies XYplorer before killing it, so it is important you give the function the right window header text. Be specific and the other apps with XYplorer in the window title will survive :)