XYplorer Automatic Updater

Discuss and share scripts and script files...
admin
Site Admin
Posts: 65244
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: XYplorer Automatic Updater

Post by admin »

jacky wrote:I don't know how easily doable it's be doing, or if Don would even like that idea, but I would like that very much, as I already have a couple script where I ask to enter 0 or 1, or make some kind of choice.
Well, you might look into confirm() in the latest beta... 8)

lukescammell
Posts: 744
Joined: 28 Jul 2006 13:15
Location: Kent, UK
Contact:

Re: XYplorer Automatic Updater

Post by lukescammell »

I can see your point of view, although including it wouldn't force you to use anything that you didn't want to apart from the autoupdate, but hey, I know it's not going to happen ;)

Does the Autoupdate script have an autoupdate? If so, how do you activate it?
Used to update to the latest beta every day. Now I have children instead…
Windows 10 Pro x64 (everywhere except phone…)

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

Re: XYplorer Automatic Updater

Post by jacky »

admin wrote:
jacky wrote:I don't know how easily doable it's be doing, or if Don would even like that idea, but I would like that very much, as I already have a couple script where I ask to enter 0 or 1, or make some kind of choice.
Well, you might look into confirm() in the latest beta... 8)
Awesome!! :D So, how do I write my own function now? :mrgreen: ;)

What's your opinion on adding the "list-support" to the input command ? I could be nice to present a list of default choices to be made, and since other similar window (e.g. go to) already have that, I'm assuming it shouldn't be too complicated to add, just disabling the MRU/auto-complete ?

(Side note: I kinda wish I could also set the title of the input's window, instead of always having "Input" there...)
lukescammell wrote:Does the Autoupdate script have an autoupdate? If so, how do you activate it?
When loading the script, on the menu should be "Check for updates of XYplorer Automatic Updater..." (at the bottom), click that and if a new version is available you should be asked whether to download it or not :)
Proud XYplorer Fanatic

lukescammell
Posts: 744
Joined: 28 Jul 2006 13:15
Location: Kent, UK
Contact:

Re: XYplorer Automatic Updater

Post by lukescammell »

I've updated the script and I'm running XY 7.60.0015 but when I "check for updates" now the script gets stuck in a loop asking for my archiver path. Even if I manually put the path in (relative or absolute) and press OK it still asks me to browse for the exe, and when I do, it goes back to asking me for the path again. Any ideas?
Used to update to the latest beta every day. Now I have children instead…
Windows 10 Pro x64 (everywhere except phone…)

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

Re: XYplorer Automatic Updater

Post by jacky »

lukescammell wrote:I've updated the script and I'm running XY 7.60.0015 but when I "check for updates" now the script gets stuck in a loop asking for my archiver path. Even if I manually put the path in (relative or absolute) and press OK it still asks me to browse for the exe, and when I do, it goes back to asking me for the path again. Any ideas?
Yeah, XY 7.60.0015 is buggy and causes such undesired effects unfortunately... :( I think you will have to either update manually this time, or revert to a previous version first before you can then update to the latest beta.
Proud XYplorer Fanatic

lukescammell
Posts: 744
Joined: 28 Jul 2006 13:15
Location: Kent, UK
Contact:

Re: XYplorer Automatic Updater

Post by lukescammell »

Just thought I'd mention that this has been working flawlessly for me for a while now, and it even did an update of itself a day or so ago. Thanks again Jacky, makes life a lot easier :)
Used to update to the latest beta every day. Now I have children instead…
Windows 10 Pro x64 (everywhere except phone…)

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

Re: XYplorer Automatic Updater

Post by jacky »

lukescammell wrote:Just thought I'd mention that this has been working flawlessly for me for a while now, and it even did an update of itself a day or so ago. Thanks again Jacky, makes life a lot easier :)
Glad it's useful, it's been saving me a lot of time as well :)
Proud XYplorer Fanatic

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

Re: XYplorer Automatic Updater

Post by jacky »

Little update:

: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
Proud XYplorer Fanatic

drewkeller
Posts: 33
Joined: 01 Nov 2008 05:29

Re: XYplorer Automatic Updater

Post by drewkeller »

I found that the script doesn't restart XYplorer for me on Vista. Maybe Vista handles the command a bit differently?

cmd thinks the single quoted parameter given in the script is the title of the window instead of the item to start. If I add the dummy title in like this, it works:

Code: Select all

&&start ""dummy title"" $drive""$path""\<xyexe>"
I haven't tried it, but supposedly this form of the command is compatible other versions of Windows:
http://www.computerhope.com/batch.htm

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

Re: XYplorer Automatic Updater

Post by jacky »

drewkeller wrote:I found that the script doesn't restart XYplorer for me on Vista. Maybe Vista handles the command a bit differently?

cmd thinks the single quoted parameter given in the script is the title of the window instead of the item to start. If I add the dummy title in like this, it works:

Code: Select all

&&start ""dummy title"" $drive""$path""\<xyexe>"
Well, that's weird and unexpected I'd say, but Vista is such a joy! :P ;)

Thanks for letting me know, I've added a dummy title as well in the latest version, so it should work in Vista just fine now, and on XP it doesn't change anything.

:arrow: Also, the latest version now includes another 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! :)
Proud XYplorer Fanatic

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

Re: XYplorer Automatic Updater

Post by jacky »

: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.
Proud XYplorer Fanatic

lukescammell
Posts: 744
Joined: 28 Jul 2006 13:15
Location: Kent, UK
Contact:

Re: XYplorer Automatic Updater

Post by lukescammell »

Looking forward to seeing some documentation on how others can utilise some of the "Jacky Common" stuff, looks like a damned good idea!

Thanks Jacky :!:
Used to update to the latest beta every day. Now I have children instead…
Windows 10 Pro x64 (everywhere except phone…)

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

Re: XYplorer Automatic Updater

Post by jacky »

: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! ;)

--
lukescammell wrote:Looking forward to seeing some documentation on how others can utilise some of the "Jacky Common" stuff, looks like a damned good idea!
Okay, just for you then ;) One thing you can use already, if you want to play with common-jacky, is "_AutoChangeLog". What it does it read your script file to "extract" the changelog and show it (using text). Of course it must follow some rules to work:
- you need to have common-jacky.xys obviously, and it needs to be in the same folder as your own script file
- your script file must have an INI section "Internal" embedded, with setting "version" set to its version number
- you must define two global vars, $XYS_name with the name of your script (e.g. self $XYS_name, base;), and $XYS_file with the path/file to the XYS (e.g. self $XYS_file, file;)
- your script file must open with a multi-line comment (/* blahblah.. */) that will be the famous changelog extracted & shown
FYI: for lines beginning with two tabulations, the 2 tabulations will be replaced by two spaces; then, for lines beginning with one tabulation, the tabulation will be removed; and finally the name of the script ($XYS_name) will be replaced by "Changelog of $XYS_name v<version>" (<version> being from the Internal INI key version, obviously)

Basically, here's a basis of what I'd use...

Code: Select all

/*	ScriptName
	
	v0.01.0000	yyyy.mm.dd	XY v7.80.0032
		+ first release
*/
"Stuff..."
	sub _ensureXY;
	msg "This should probably do something...";
-
"_ensureXY"
	global $XYS_name, $XYS_file;
	self $XYS_file, file;
	getkey $XYS_name, "name", "Internal", $XYS_file;
	getkey $xyreq, "requiresXY", "Internal", $XYS_file;
	setting "AllowRecursion", 1;
	sub (compare(<xyver>, $xyreq, v) >= 0) ? "_nothing" : "_ensureXYfailed";
"_ensureXYfailed"
	global $XYS_name;
	self $file, file;
	getkey $xyreq, "requiresXY", "Internal", $file;
	msg "WARNING: This version of $XYS_name requires XYplorer v$xyreq in order to work properly.<br><br>You are currently running an older version (<xyver>), are you sure you want to continue anyway ?<br><br>Note that this might lead to errors / unexpected results.", 1;
"Show changelog... : AutoChangelog"
	global $CJ_tmp;
	sub _ensureXY;
	$CJ_tmp = "_AutoChangelog";
	sub _callCommonJacky;
	load *;
"_callCommonJacky"
	global $CJ_tmp;
	self $file, file;
	self $path, path;
	getkey $cj_req, "requiresCJ", "Internal", $file;
	getkey $cj_ver, "version", "Internal", "common-jacky.xys";
	end $cj_ver == "", "In order to accomplish the desired operation, you need to have the ""library"" common-jacky.xys installed -- Please download the script file and put it in the same folder as this script file ($path\).", 1;
	end (compare($cj_ver, $cj_req, v) == -1), "In order to accomplish the desired operation, you need to have the ""library"" common-jacky.xys v$cj_req or more installed, your current version is v$cj_ver -- Please update to the latest version.", 1;
	load "common-jacky", "$CJ_tmp";
-
"Cancel : nothing"
"_nothing"
"_settings"
	[Internal]
	name="ScriptName"
	version="0.01.0000"
	requiresXY="7.80.0032"
	requiresCJ="0.01.0001"
Have fun! ;)
Proud XYplorer Fanatic

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

Re: XYplorer Automatic Updater

Post by jacky »

:arrow: The latest version of the script is 0.01.0012 and can be downloaded from here. Requires XY 7.90.0030 and CJ 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.
Proud XYplorer Fanatic

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

Re: XYplorer Automatic Updater

Post by serendipity »

Wow Jacky!!! I just tried your new script and its incredible. Thanks for this nice script.

Post Reply