setting "BackgroundFileOps", "0"; //avoid timing problems by temporarily switching to synchronous file operations mode $allitems = get("SelectedItemsPathNames", "|"); //create a |-separated list of full paths+names of all the selected items foreach ($item, "$allitems", "|") { zip_extract($item, "", "XYplorer.exe"); //extract XYplorer.exe in the same folder the archive is located $time = report("{modified yyyy-mm-dd hh.nn.ss}", "\XYplorer.exe"); //get the full date and time XYplorer was compiled in ISO 8601 format $year = substr($time, 0, 4); //extract just the year $dst_begin = $year."-03-".(31 - ((floor((5 * $year) / 4) + 4) % 7)); //when European DST begins, in ISO 8601 - https://en.wikipedia.org/wiki/European_Summer_Time#Exact_timing_for_the_next_several_years $dst_end = $year."-10-".(31 - ((floor((5 * $year) / 4) + 1) % 7)); //when European DST ends, in ISO 8601 - https://en.wikipedia.org/wiki/European_Summer_Time#Exact_timing_for_the_next_several_years if (compare($time, $dst_begin, "d") == -1 OR compare($dst_end, $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 (UTC+1 to UTC) } else { //else... $time = formatdate($time, "yyyy-mm-dd hh.nn.ss", "h", -2); //...push it 2 hours back (UTC+1+DST to UTC) }; $vers = property("ProductVersion", "XYplorer.exe"); //get the version of XYplorer.exe 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", "\XYplorer.exe", "1"); //calculate the SHA256 of the running version of XYplorer $name_pattern = "XYplorer $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", "\XYplorer.exe"; //delete XYplorer.exe without prompt nor recycle bin wait "500"; //wait a little, just to be safe... };