XYplorer Automatic Updater

Discuss and share scripts and script files...
Post Reply
jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

XYplorer Automatic Updater

Post by jacky »

There's already been a few auto-updater shared here, I know, but I thought what the Hell let me add mine to the list! ;)

---------------------------------------------------------------------------------------------------

UPDATE: Latest info on September 26, 2010 :

:arrow: The latest version of the script is 0.01.0023 and can be downloaded from this post, right below. Requires XY 7.90.0261 and common-jacky 0.01.0006
XYplorer Automatic Updater.xys
v0.01.0023
(58.14 KiB) Downloaded 373 times
:arrow: I'm putting it here so it's available again, should people be interested, and also because since Don changed the format of the changelog a bit, updates weren't found anymore, and that's been fixed.

---------------------------------------------------------------------------------------------------

UPDATE: Latest info on February 9, 2009 :

:arrow: The latest version of the script is 0.01.0020 and can be downloaded from here. Requires XY 7.90.0075 and common-jacky 0.01.0006

:arrow: "Edit Configuration File" now done directly inside XY

:arrow: Default theme on XY forum was changed, and broke the way the changelog was obtained, fixed.

:arrow: XYAU is now treated just like any (other) scripts when it comes to checking for its updates -- i.e. no more setting AutoUpdate

:arrow: Now when checking for updates of scripts & XY is all done at once, and then all results are shown on one single window. Changelog for scripts are also featured, and you chose what to update simply by checking the available updates!

---------------------------------------------------------------------------------------------------

UPDATE: Latest info on January 18, 2009 :

:arrow: The latest version of the script is 0.01.0016 and can be downloaded from here. Requires XY 7.90.0030 and common-jacky 0.01.0004

:arrow: Remove ZIP files of old versions didn't work since v0.01.0007 (!), fixed

:arrow: On occasions you could have a recursion warning showing up (when checking for BETA, after the changelog was shown), fixed.

:arrow: Check for Official: now when a new official version is available, the highlight of main new features (from website) is shown when asked whether or not to do the update


---------------------------------------------------------------------------------------------------

UPDATE: Latest info on January 14, 2009 :

:arrow: The latest version of the script is 0.01.0014 and can be downloaded from here. Requires XY 7.90.0030 and common-jacky 0.01.0003

:arrow: BETA updates: now the question/buttons to update or not are always visible, evne with long changelog

:arrow: On first use (no config), when the config screen showed up you could not (fully) set things and continue. Which could have had the configuration window show a second twice, and the check for updates be done ignoring the beta/official choice or without all settings set, fixed.

---------------------------------------------------------------------------------------------------

UPDATE: Latest info on January 9, 2009 :

:arrow: The latest version of the script is 0.01.0012 and can be downloaded from here. Requires XY 7.90.0030 and common-jacky 0.01.0002

:arrow: Reorganized menu (moved items, hide some as well)

:arrow: "Extract a previous version" now waits for extraction to be over :)

:arrow: Configuration now done with a nice single HTML driven window

:arrow: Now uses (or can use) common settings (through common_jacky) to get config for extraction

:arrow: When download folder contained a version number, features to extract and revert back to previous version didn't work, menus were wrong, fixed.

:arrow: Changelog of XY now shown in HTML format, and comes with button a button to do the update right there (one less popup!)
Tip: If you like the good old text-way better, you can have it back by adding under [Settings] in the INI file: ChangelogText=1

:arrow: When checking for official version, extraction could fail due to a wrong ZIP filename ("no archive"), fixed.

:arrow: Asking to check for updates of scripts but not XYAU would result in checking for no scripts at all, only XY; fixed.

---------------------------------------------------------------------------------------------------

UPDATE: Latest info on December 26, 2008 :

:arrow: The latest version of the script is 0.01.0011 and can be downloaded from here. Requires XY 7.80.0032

:arrow: There's a new dependency, in form of an additional script file (common-jacky.xys) that you can download from here. This new script will allow different scripts to use the same "features" without having to pack all the same codes, etc It's a "library", can't be loaded on its own (I mean it can be, but it won't do nothing ;)).

:arrow: There's been different little changes and fixes, as well as the introduction of "hidden" items, so you need to click on "Show Full Menu" to see them. For example, the feature "Get changelog" has been hidden, and so is the new "Edit Configuration File" (just opens the INI file)

:arrow: The major addition, related to our common-jacky mentioned above, is of course the possibility to use XYAU (this script! ;)) to check for updates of other scripts. Since I do work on a few scripts of my own that needs updates, since I use them on different computers or share them with other people, I wanted to quick & easy way to check for & update them all at once, so what better that using this script!

As of this writing, XYUA can check for updates of itself, common-jacky and MiniTrees (as well as XY, of course!) That means it can check for updates for everything when you click "Check for updates", and it can download the new script file when a new version is available. You can also just install support for those scripts in XYAU without enabling the automatic check for updates, then there's a menu "Check for updates of additional scripts..." with both the possibility to "Check for updates of all scripts..." as well as checking for individual ones.

Technically, support for any script could be added (given a few rules are followed), but I'm already thinking of ways to automate all of that even more and make it more accessible, to allow everyone to have their scripts' updates handled through XYAU easily... stay tuned! ;)

---------------------------------------------------------------------------------------------------

UPDATE: Latest info on December 5, 2008 :

:arrow: The latest version of the script is 0.01.0008 and still available from here. Requires XY 7.80.0032

:arrow: Now when entering the path to the unrar.exe, the script will auto-convert it to a relative path if possible and ask you how to save it (full or relative)

:arrow: Script changelog can be shown

:arrow: Relative syntax ?:\path\to\unrar.exe did not work when extracting old versions of XY, fixed.

:arrow:Using "Check for Updates" with check for auto-update first, when a new version of the script was found, it was downloaded but the old version (loaded in memory) would do the XY-check/download procedure. Now, the freshly downloaded new version of the script will.

:arrow: Plus a few internal changes, like dealing with recursion which now is done using setting AllowRecursion, and thus the script should work just fine (and without warnings) even when recursion checked is still enabled.

---------------------------------------------------------------------------------------------------

UPDATE: Latest info on November 6, 2008 :

:arrow: The latest version of the script is 0.01.0007 and still available from here. Requires XY 7.70.0010

:arrow: It now includes a new feature : Extract a previous version. Like for the revert back option, it will list all previous versions available and in one click create a new folder (XYplorer vX.XX.XXXX) in the current location and extract said version of XY in the folder.
It will also create a new XYplorer.ini file with your registration info (taken from <xydata>\XYplorer.ini). So if you ever want to test something with an older version it couldn't be easier now! :)

---------------------------------------------------------------------------------------------------

UPDATE: Latest info on November 1st, 2008 :

:arrow: The latest version of the script (still available from here) requires XY 7.70.0010 and uses global variables now, no more tmp.ini ! :D

:arrow: There were a few minor changes/fixes, including a test that recursion checker is off, because otherwise you might get lots of warnings using the script (especially when checking for BETA versions). This check is only done once of course.

:arrow: For the record, a version compatible with the last official version (7.70.0000) is available from here

---------------------------------------------------------------------------------------------------

UPDATE: The original script has been modified since that first post, here's the latest :

:arrow: No more copy/paste, you can now simply download the XYS file from here.

:arrow: It uses latest syntax changes that aren't supported in previous versions, now requires XY 7.60.0009 in order to work.

:arrow: I've added a couple of things since last time, starting with function to Revert to a previous version. This will simply do the same thing as always, only without downloading anything but using one of the previously downloaded ZIP file. That way, if for some reason you ever want to revert back to an old version, it will be done in a couple of clicks just as easily as when updating to the latest version :) (Been doing that these past couple of days, pretty cool)

:arrow: Also, since ZIP files are added and added all the time, added a little thing to quickly remove a bunch of them easily as well

:arrow: Because I intend to give this script to a few people (XY users) I know, and they don't all use latest beta, I added an option to check for the latest official version as well. So now it supports updating both to latest beta, or latest official version (no changelog there).

:arrow: In the same idea, cause I didn't want to explain how to update the script file every time they'd need to update it, I've also added a "check for update" function for the script itself. If everything works nicely, next time I update it, using this feature you'll be able to update to the latest version of the script in two clicks as well :)

Original post below:
---------------------------------------------------------------------------------------------------


So this is my own script to update XY, I've been using it for a little while now (though it's been modified/improved over time...) and I think it works just fine. At least I haven't had any problem with it -- but you're free to to test it at least once on a copy of your installation, just to be sure. (Plus I won't be responsible if your PC explodes or anything... ;))

How it works : you start it, it will either tell you that you have the latest BETA, or show you the changelog for all versions after the one you're running. Then, you'll be asked if you want to update or not, if so it will all be done automatically: downloading, extracting, restarting.


This is just an XY Script File, and it doesn't require anything else (no bat, exe, etc) but one thing : an application to do the unzipping (e.g. WinRAR, 7z, etc).

Once you'll have copy/pasted the script into your own "XYplorer Automatic Updater.xys" (tip: Ctrl+Alt+V to Paste Text Into New File) you're almost good to go. To use it, you simply load the file and click on "Check for Updates..." or directly load the script "CheckForUpdates", so if you did copy/paste it as "XYplorer Automatic Updater.xys" in your Script folder, this will do: ::load "XYplorer Automatic Updater", "CheckForUpdates";

The first time you use it, you'll be asked a couple of questions : name, age, ... err, no, I mean- first, the application to use to do the unzipping (you can browse to it, if you don't you should still use a full path/name to the exe file, i.e. not "WinRAR" even if it is a registered app). Then, the arguments to use/send on command line.

When used, the script will start your unzipper with one goal : unzip the freshly downloaded ZIP file over your current installation. This means you'll want to unzip to your current <xypath> obviously, and you probably want to remove any confirmation of overwriting. For the ZIP file, simply use %zip% and it'll be replaced by the full path/name to the file; as destination, you shall use <xypath>\ (note the required backslash). You'll want to "quote" them if needed (i.e. spaces are involved).

For example, here's what I use with WinRAR:

Code: Select all

e "%zip%" XYplorer.exe XYplorer.hlp XYplorer.cnt TipOfTheDay.htm LicenseXY.txt ReadmeXY.txt "<xypath>\" -o+
Yeah, I list the files to extract for safety. Was useful when there was still a catalog.dat in the ZIP, especially since I got no overwriting confirmation! ;)

Lastly, you'll be asked for the folder where to download the ZIP. The way it works (though you are obviously free to change that) is that it will download the file xyplorer_X.XX_beta_noinstall.zip into that folder, but the file will be renamed to xyplorer_X.XX.XXXX_noinstall.zip which means that you should be able to revert back to any past versions quite easily (should you want to); and also you might wanna do some cleaning in that folder every once in a while. ;)

Okey dokey, here's the beast :
(...)

A few more things :

- I'm a bit late on XYwiki so it's not there yet, but you should know that XY's readurl (& download) do send IE cookies, and to check if there's a new BETA / get the changelog this script opens a page from this forum. Meaning: if you use IE as browser (or a shell) & have an auto-loggin cookie, every time you use this script you'll be logged on, and so if you don't actually visit too it will screw up you unread topics !!
EDIT: Okay, just added the new command internetflags so now (v7.60.0002 onwards) the cookies won't be send anymore, no more worries!

- Yes it uses a tmp.ini since there are no global vars, but the file is removed when done. If for some reason you already have a tmp.ini you don't want to see disappear, I suggest a quick search&replace ;)
EDIT: Not the case anymore, thanks to global vars!

- When restarting XY, I use #192; to close, which means that your settings will be saved ONLY if you have "save settings on exit" enabled, otherwise no save.

- For curious people, the little self-ping trick used here is just to wait and "ensure" XY.exe is done, so when extracting the new EXE there aren't any problem...

That's all folks!
Last edited by jacky on 26 Sep 2010 19:32, edited 13 times in total.
Proud XYplorer Fanatic

j_c_hallgren
XY Blog Master
Posts: 5824
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Re: XYplorer Automatic Updater

Post by j_c_hallgren »

:shock: OMG! What next? A compiler written in XY Script? :lol:

I'll have to bow to jacky for even attempting this, so you, sir, have definitely earned my respect even more than before! Now I've not tried it but just looking at this beast, I see you've spent a lot of time on this and I'm sure that users will appreciate it greatly. Great job!
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: XYplorer Automatic Updater

Post by admin »

Wow! This what not on my mind when I introduced scripting. I created a monster. No, jacky did! :wink:

Interesting side note about the cookies. I had no idea. But I can turn that behavior off easily. Any complaints?

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: XYplorer Automatic Updater

Post by TheQwerty »

admin wrote:Interesting side note about the cookies. I had no idea. But I can turn that behavior off easily. Any complaints?
I request that it be a parameter to the function instead.

Or really a new command similar to Setting()... InternetOptions(Option, Value);
Then in the future it will be easier to allow bypassing or changing the other options (use IE's cache/proxy settings/etc.) plus script writers would only need to call it once in a script instead of having the parameter on each call.

EDIT: The reason being that it is useful to have access to the cookies if you want to access a website that requires login.

admin
Site Admin
Posts: 60567
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: XYplorer Automatic Updater

Post by admin »

TheQwerty wrote:
admin wrote:Interesting side note about the cookies. I had no idea. But I can turn that behavior off easily. Any complaints?
I request that it be a parameter to the function instead.

Or really a new command similar to Setting()... InternetOptions(Option, Value);
Then in the future it will be easier to allow bypassing or changing the other options (use IE's cache/proxy settings/etc.) plus script writers would only need to call it once in a script instead of having the parameter on each call.

EDIT: The reason being that it is useful to have access to the cookies if you want to access a website that requires login.
Okay, possible. But the default for cookies should be "off" IMO.

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: XYplorer Automatic Updater

Post by serendipity »

This is awesome Jacky. :shock: .

eurytos
Posts: 200
Joined: 29 Jan 2008 15:53

Re: XYplorer Automatic Updater

Post by eurytos »

wow is all I can say!

:shock:

avsfan
Posts: 554
Joined: 29 Jun 2006 09:00
Location: Fort Collins, Colorado

Re: XYplorer Automatic Updater

Post by avsfan »

admin wrote:Wow! This what not on my mind when I introduced scripting. I created a monster. No, jacky did! :wink:

Interesting side note about the cookies. I had no idea. But I can turn that behavior off easily. Any complaints?
Well, as I use the auto-login and cookies for unread topics, I'd really prefer *not* to lose that functionality...

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: XYplorer Automatic Updater

Post by jacky »

Glad you guys like it, hopefully you'll keep liking it after using it ;)
admin wrote:Wow! This what not on my mind when I introduced scripting. I created a monster. No, jacky did! :wink:
Oh look, my nice little script called a "monster" by the mean admin, cause he's jealous he can't use it, because there never is a version that's more recent than the one he uses... :P ;)
admin wrote:Interesting side note about the cookies. I had no idea. But I can turn that behavior off easily.
Yeah, the ability to turn that setting on/off could be pretty nice indeed. I agree with TheQwerty, using a setting-like command to set it once for the entire script would probably be best.
Proud XYplorer Fanatic

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: XYplorer Automatic Updater

Post by jacky »

Script updated, cookie troubles are gone now! :)
Proud XYplorer Fanatic

graham
Posts: 457
Joined: 24 Aug 2007 22:08
Location: Isle of Man

Re: XYplorer Automatic Updater

Post by graham »

just to add my WOW too - great stuff but too clever for me - still over the coming winter I shall dig inside your code to learn a bit more about scripting - the only problem I can see is you keep finding ways round omissions in scripting as it is now - Don seems to be slowly releasing a few new commands every now and then, but I still want to see the decision type commands - I think he loves to tease the user base and feel sure most of it already is coded.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: XYplorer Automatic Updater

Post by TheQwerty »

graham wrote:just to add my WOW too - great stuff but too clever for me - still over the coming winter I shall dig inside your code to learn a bit more about scripting - the only problem I can see is you keep finding ways round omissions in scripting as it is now - Don seems to be slowly releasing a few new commands every now and then, but I still want to see the decision type commands - I think he loves to tease the user base and feel sure most of it already is coded.
And if jacky gets his way we're going to see onEvent scripting long before we get real logic to replace the annoying string manipulations. :|

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: XYplorer Automatic Updater

Post by jacky »

TheQwerty wrote:And if jacky gets his way we're going to see onEvent scripting long before we get real logic to replace the annoying string manipulations. :|
hmm.. that's right, I vote for onEvent Actions before the now scripting 3.0, but you say that like it's be a bad thing?

I mean I understand this string manipulations aren't ideal and might not be accessible to everyone (and so will be S3.0), and I'd love to get ride of it, but it's nothing that is not supported by XYS. Don might not have thought of it when he implemented e.g. regexreplace & sub, but nothing "illegal" is being done here.

Adding to that how onEvent actions could be (IMO) a great, useful & powerful feature, and one that could be used by everybody, it doesn't require anything to be used : anyone could want his own context menu on middle-click, a different action on dbl-clicking a Tab header or a simple script relating to current location on middle/dbl-click on Tree, etc

It all could be used without the need of S3.0 or those string manipulations to have conditions, loops and such. Those aren't required, just a (great) added bonus, as if true today with scripting from UDC, Catalog, etc.

And the way I see it, time is an important matter, given how Don is only a man and can't do everything even he dreams he could do by the end of the day. And I feel, though obviously I base this on pretty much nothing but "guesses" as I don't know how things do work internally, it would be quite "easier" - not to mention less time-consuming - for Don to track events and then trigger actions, than to do what may very well end in major changes to the scripting engine, internally and/or publicly.

Because adding conditions, evaluations of expressions (and you can be sure it will also lead to maths stuff as in "if $i > 2*$b then"...), loops, or functions might require a lot of "behind the scene" work, if not syntax changes... and thus would seem to me like a much bigger task.

Not to say it's not worth it, it certainly is, but considering all that Don has on his very long to-do list and how time plays into this, yeah, you bet I'd want onEvent actions first, because there's no way to workaround it, I'm sire it could be added sooner than scripting 3.0 ever could or will be, and it would be a great addition to XY - and again, that's true even without anything close to conditions, loops, etc
Proud XYplorer Fanatic

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: XYplorer Automatic Updater

Post by TheQwerty »

And as I've repeatedly said, I don't deny the greatness that will be support of events within scripting. But logic is a damn basic foundation of all scripting and programming languages. You may love doing RegExReplaces instead of simple if...else... but it is a royal pain, it is sloppy, and it's not at all something the majority of users can use. I also never called it "illegal" but it is a cheap and ugly hack.

While the actual onEvent triggering may be trivial for Don to add, it will also require some type of interface and to do that well will not be as simple at all.

I also think more people would like to easily perform tasks differently based on the selected file(s) than whenever they double click a tab. Or having the ability to easily loop over the current selection instead of firing events when they browse to a specified folder.


Logic is part of a language's foundation. It's painful for everyone to continue on this path and build onEvent actions before logic. You don't build a house on a faulty foundation just because it will work for now and in the future you can fix those faults. Your way would mean we'd all write even more scripts using this ugly work-around and then have to go back and clean them up when we finally get logic. And when would that be? Scripting 10.0 or something, because while we already have this REP method, there will always be something else that we can't possibly do. "It's imperative that we add audio and video playback next, because there is just no way for me to stream music in XY, but there is a way to do logic!" Actually that's a bad example, since the ability to play audio already exists before logic, but if does get my point across.

j_c_hallgren
XY Blog Master
Posts: 5824
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Re: XYplorer Automatic Updater

Post by j_c_hallgren »

So could we possibly explore the possibility of a very limited OnEvent ability (which might be reworked later) as an interim, thus making conditional logic more of a priority?
I'm thinking that there might be one or two OnEvent conditions that would be the most heavily used and which could be very helpful until a more complete set is available...not sure which ones they would be, so maybe jacky can provide some ideas on this.
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

Post Reply