The Unofficial XYplorer Archive

Discuss and share scripts and script files...
Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: The Unofficial XYplorer Archive

Post by Marco »

:oops: I never updated that section after I moved from dropbox to onedrive, argh! I'll do that now.
Meanwhile, to gain access to the Archive you just need to give an email address to which I can send an invitation - in a private message of course :)
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: The Unofficial XYplorer Archive

Post by bdeshi »

this script and the "Archiver" from SimpleUpdater name the archive with different dates. ???
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: The Unofficial XYplorer Archive

Post by Marco »

That shouldn't happen (at least if your time zone is CET) :eh: Do you have any example?
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: The Unofficial XYplorer Archive

Post by bdeshi »

Sure.

Code: Select all

SUpdater's Archiver:
XYplorer 15.00.0521 [2015-04-30 16.34.52] [44aac6bf5e8af1418126aea7b0416cdc80125045baf7692b6b40cc0f5b0cd243 80032d5eb3803b23b3d584d42064eb94fb2e5410b83d0e0d86ef90d3ee71faa8].zip
the Unofficial XYplorer Archive script:
XYplorer 15.00.0521 [2015-04-30 20.34.52] [44aac6bf5e8af1418126aea7b0416cdc80125045baf7692b6b40cc0f5b0cd243 80032d5eb3803b23b3d584d42064eb94fb2e5410b83d0e0d86ef90d3ee71faa8].zip
Which one is correct?

ed. My timezone is GMT+6. :whistle:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: The Unofficial XYplorer Archive

Post by Marco »

The second one. And the reason is quite simple, and actually something I never "fixed" because I thought no one would use the Archiver code.

Explanation :D

The Archiver code picks XYplorer.exe date as property("Write", "<xy>"), which returns an UTC time directly from the NTFS record of the file on your hard drive (basically, date you see in the IP minus <get UTCOffset> minutes, as per Help page 525). However XYplorer.exe is not created on your system, rather it comes from Don's computer which is located in the land of Oktoberfest :beer: (UTC+1, aka CET). But you don't live there, so even if you see the same creation date in the IP, the property above returns a different result.

The Unofficial Archive script relies on report("{modified yyyy-mm-dd hh.nn.ss}", ...), which returns what you see in the IP, instead. That code "knows" that we are dealing with a CET time, and therefore performs something else to obtain the UTC value, namely

Code: Select all

  if (compare($time, eval($dst_b_$year), "d") == -1 OR compare(eval($dst_e_$year), $time, "d") == -1) {	//if time is NOT during DST...
   $time = formatdate($time, "yyyy-mm-dd hh.nn.ss", "h", -1);						//...push it just 1 hour back (from UTC+1 to UTC),...
  } else {												//...else...
   $time = formatdate($time, "yyyy-mm-dd hh.nn.ss", "h", -2);						//...push it 2 hours back (from UTC+1 + DST to UTC)
  };
So, why two different codes? Historical reasons. The Archiver code comes first, before TUXA was officially born. It was a personal project, and since my time zone is CET I had no reason to take into account different timezones. That necessity came later on, with TUXA.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: The Unofficial XYplorer Archive

Post by bdeshi »

Good to know. I've not uploaded any version renamed with "_Archiver" to the Arc; it's integrity remains unscathed. :titter:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: The Unofficial XYplorer Archive

Post by bdeshi »

I've made a little modification that downloads latest beta and renames it. Archive is placed in <xydata>\TUXYA\ by default.
Save the script as a file, then load it as load "path\to\thisscript.xys","_dlntuxya",f;
Assuming this is saved as <xyscripts>\DLnTUXYA.xys, call it in this way:

Code: Select all

load "dlntuxya.xys","_dlntuxya",f;

Code: Select all

"TUXYA : tuxya"
 //modified 4 regions. Modification are commented. The caption above is part of the modification
 global $allitems; // //<< modified. 
 setting "BackgroundFileOps", "0";							//avoid timing problems by temporarily switching to synchronous file operations mode

 if ($allitems == '') { $allitems = get("SelectedItemsPathNames", <crlf>); }					//create a ¶-separated list of full paths+names of all the selected items 
 // // ^^ modified. 
 $total = gettoken("$allitems", "count", <crlf>);					//count the number of selected files
 $i = 1;										//start the counter

 $dst_b_1999 = "1999-03-28";								//$dst_b_1999 = "1999-03-".(31 - ((floor((5 * 1999) / 4) + 4) % 7));
											//when European DST began in 1999, in ISO 8601 - https://en.wikipedia.org/wiki/European_Summer_Time#Exact_timing_for_the_next_several_years
 $dst_e_1999 = "1999-10-31";								//$dst_e_1999 = "1999-10-".(31 - ((floor((5 * 1999) / 4) + 1) % 7));
											//when European DST ended in 1999, in ISO 8601 - https://en.wikipedia.org/wiki/European_Summer_Time#Exact_timing_for_the_next_several_years

 $dst_b_2000 = "2000-03-26"; $dst_e_2000 = "2000-10-29";
 $dst_b_2001 = "2001-03-25"; $dst_e_2001 = "2001-10-28";
 $dst_b_2002 = "2002-03-31"; $dst_e_2002 = "2002-10-27";
 $dst_b_2003 = "2003-03-30"; $dst_e_2003 = "2003-10-26";
 $dst_b_2004 = "2004-03-28"; $dst_e_2004 = "2004-10-31";
 $dst_b_2005 = "2005-03-27"; $dst_e_2005 = "2005-10-30";
 $dst_b_2006 = "2006-03-26"; $dst_e_2006 = "2006-10-29";
 $dst_b_2007 = "2007-03-25"; $dst_e_2007 = "2007-10-28";
 $dst_b_2008 = "2008-03-30"; $dst_e_2008 = "2008-10-26";
 $dst_b_2009 = "2009-03-29"; $dst_e_2009 = "2009-10-25";
 $dst_b_2010 = "2010-03-28"; $dst_e_2010 = "2010-10-31";
 $dst_b_2011 = "2011-03-27"; $dst_e_2011 = "2011-10-30";
 $dst_b_2012 = "2012-03-25"; $dst_e_2012 = "2012-10-28";
 $dst_b_2013 = "2013-03-31"; $dst_e_2013 = "2013-10-27";
 $dst_b_2014 = "2014-03-30"; $dst_e_2014 = "2014-10-26";
 $dst_b_2015 = "2015-03-29"; $dst_e_2015 = "2015-10-25";

 foreach ($item, "$allitems", <crlf>) {
  if (getpathcomponent("$item", "ext") != "zip") {					//if the extension of the processed item is NOT zip...
   status "[$i/$total]: $item", , "alert";						//...give some visual feedback in the status bar,...
   $i++;										//...raise the counter and...
   wait "500";										//(wait a little, just to be safe)
   continue;										//...skip it and continue with the next one
  };

  $path = getpathcomponent("$item", "path") . "\";					//path of the current item, with final slash added
  $filelist = zip_list($item, <crlf>);							//inspect the processed item...
  $subject = regexmatches($filelist, "XYplorer.*?\.exe");				//...and try to find what it contains

  if ($subject != "") {									//if there is an executable compatible with this script...
   zip_extract($item, $path, $subject);							//...extract it in the same folder the archive is located...
  } else {										//...otherwise...
   status "[$i/$total]: $item", , "alert";						//...give some visual feedback in the status bar,...
   $i++;										//...raise the counter and...
   wait "500";										//(wait a little, just to be safe)
   continue;										//...skip it and continue with the next one
  };

  $time = report("{modified yyyy-mm-dd hh.nn.ss}", $path . $subject);			//get the full date and time XYplorer was compiled in ISO 8601 format
  $year = substr($time, 0, 4);								//extract just the year

  if (compare($time, eval($dst_b_$year), "d") == -1 OR compare(eval($dst_e_$year), $time, "d") == -1) {	//if time is NOT during DST...
   $time = formatdate($time, "yyyy-mm-dd hh.nn.ss", "h", -1);						//...push it just 1 hour back (from UTC+1 to UTC),...
  } else {												//...else...
   $time = formatdate($time, "yyyy-mm-dd hh.nn.ss", "h", -2);						//...push it 2 hours back (from UTC+1 + DST to UTC)
  };

  $vers = property("ProductVersion", $path . $subject);					//get the version of XYplorer in the nn.xx.yyyy form
  $vers = ("$vers" Like "*#.##.####") ? "$vers" : "$vers.0000";				//pads the version number with zeros if necessary

  $hash_zip = hash("sha256", $item, "1");						//calculate the SHA256 of the downloaded .zip file
  $hash_xy = hash("sha256", $path . $subject, "1");					//calculate the SHA256 of XYplorer executable

  $name_pattern = substr($subject, 0, -4) . " $vers [$time] [$hash_zip $hash_xy].zip";	//name pattern of the .zip file once archived
  renameitem($name_pattern, $item);							//rename the .zip file

  delete "0", "0", $path . $subject;							//delete XYplorer executable without prompt nor recycle bin
  status "[$i/$total]: $item";								//give some visual feedback in the status bar
  $i++;											//raise the counter
  wait "500";										//wait a little, just to be safe...
 };

 // //vv till end vv modified (added)
"DLnTUXYA : _DLnTUXYA"
  //downloads latest beta noinstall zip archive to <xydata>\tuxya and sends that to main script for renaming.
  global $allitems;
  $latestbetapage = readurl('http://www.xyplorer.com/version.php', 1,, 1); //get latest major version
  $latestbetaver  = substr($latestbetapage, 0, 5); //extract maj.min. eg 15.00
  if ($latestbetaver == '') {status 'error retrieving latest major version report',,'stop'; end 1;}
  $downloadfile   = new( <xydata> . '\TUXYA\XYplorer_' . $latestbetaver . '_beta_noinstall.zip', 'file'); //auto auto-prefixing if filename is taken
  download 'http://www.xyplorer.com/download/xyplorer_'. $latestbetaver .'_beta_noinstall.zip', $downloadfile, 'o'; //downlado the file
  if (filesize($downloadfile) == 0) {status 'download failed',,'stop'; end 1;} //if target filesize remains 0, assume download failed
  else { $allitems = $downloadfile; sub "tuxya"; } //send the downloaded archive as input (as global var) to mian script
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: The Unofficial XYplorer Archive

Post by Marco »

You can find the latest major version number directly here, http://www.xyplorer.com/version.php :wink:
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: The Unofficial XYplorer Archive

Post by bdeshi »

Okay, modified the modification.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: The Unofficial XYplorer Archive

Post by bdeshi »

hey, how come there are two 15.10.0002's in the archive?
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

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

Re: The Unofficial XYplorer Archive

Post by admin »

There was a silent hotfix only minutes after the first upload. I did not change the number. :ninja:

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: The Unofficial XYplorer Archive

Post by Marco »

admin wrote:There was a silent hotfix only minutes after the first upload. I did not change the number. :ninja:
That ^^ The background utility caught two .0002, and to be faithful to events I uploaded both :)
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

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

Re: The Unofficial XYplorer Archive

Post by admin »

Marco wrote:
admin wrote:There was a silent hotfix only minutes after the first upload. I did not change the number. :ninja:
That ^^ The background utility caught two .0002, and to be faithful to events I uploaded both :)
Wow, and I thought I could fool it. :whistle:

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: The Unofficial XYplorer Archive

Post by Marco »

Today, and maybe tomorrow too, I'll be offline - new laptop, it needs a good format and proper reinstallation of everything. I'll thank whoever can stay tuned on the beta forum for me (Sammay I know you'll be one of them :biggrin: )
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: The Unofficial XYplorer Archive

Post by Marco »

I was all yesterday long, does someone still have 15.70.0107?
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

Post Reply