SU Helper
Posted: 05 Jun 2013 21:12
SU_Helper
This script works together with SimpleUpdater script (hereafter referred to as SU).
So first make sure you have set that script right.
Credits go to Marco for maintaining the SU script so well.
WHAT THIS SCRIPT DOES?
The script gives a visual feedback(button change in toolbar) and optionally a sound feedback
if a new XY version is available.
It's most useful if you call this script when XY starts.
Check D. in "How to set it up" below.
HOW IT WORKS?
The script reads the SU script file, stores the script in memory,
adds some more code to the stored script on-the-fly and loads the script from memory.
Note: This script does *not* make any changes to the original SU script file.
But make sure you have the correct version. See A below.
HOW TO SET IT UP?
Ofcourse, you need this script itself which should be inside XY's script folder. Then follow below instructions:
A. Make sure you have this version of SU: Rev. 10.66 / 2013/04/24
Link: http://www.xyplorer.com/xyfc/viewtopic. ... 990#p77990
B. Setup a button in the toolbar and note down the button index (see code below). Follow above link and go to Tips section to set it up.
C. Read User Settings #1 to #5 below carefully and change them accordingly
optional
D. You can call this script when XYplorer starts. Right-click on the XY shortcut and
paste below code towards the end in the target field:
If sufficient people are interested it will be incorporated directly in the main SimpleUpdater script.
This script works together with SimpleUpdater script (hereafter referred to as SU).
So first make sure you have set that script right.
Credits go to Marco for maintaining the SU script so well.
WHAT THIS SCRIPT DOES?
The script gives a visual feedback(button change in toolbar) and optionally a sound feedback
if a new XY version is available.
It's most useful if you call this script when XY starts.
Check D. in "How to set it up" below.
HOW IT WORKS?
The script reads the SU script file, stores the script in memory,
adds some more code to the stored script on-the-fly and loads the script from memory.
Note: This script does *not* make any changes to the original SU script file.
But make sure you have the correct version. See A below.
HOW TO SET IT UP?
Ofcourse, you need this script itself which should be inside XY's script folder. Then follow below instructions:
A. Make sure you have this version of SU: Rev. 10.66 / 2013/04/24
Link: http://www.xyplorer.com/xyfc/viewtopic. ... 990#p77990
B. Setup a button in the toolbar and note down the button index (see code below). Follow above link and go to Tips section to set it up.
C. Read User Settings #1 to #5 below carefully and change them accordingly
optional
D. You can call this script when XYplorer starts. Right-click on the XY shortcut and
paste below code towards the end in the target field:
Code: Select all
/script="::load 'SU_Helper.xys';"If sufficient people are interested it will be incorporated directly in the main SimpleUpdater script.
Code: Select all
/*
[size=150][u]SU_Helper[/u][/size]
This script works together with SimpleUpdater script (hereafter referred to as SU).
So first make sure you have set that script right.
Credits go to Marco for maintaining the SU script so well. :)
WHAT THIS SCRIPT DOES?
The script gives a visual feedback(button change in toolbar) and optionally a sound feedback
if a new XY version is available.
It's most useful if you call this script when XY starts. Check D. in "How to set it up" below.
HOW IT WORKS?
The script reads the SU script file, stores the script in memory,
adds some more code to the stored script on-the-fly and loads the script from memory.
Note: This script does *not* make any changes to the original SU script file.
But make sure you have the correct version. See A below.
HOW TO SET IT UP?
Ofcourse, you need this script itself which should be inside XY's script folder. Then follow below instructions:
A. Make sure you have this version of SU: Rev. 10.66 / 2013/04/24
Link: http://www.xyplorer.com/xyfc/viewtopic.php?p=77990#p77990
B. Setup a button in the toolbar and note down the button index (see below). Follow above link and go to Tips section to set it up.
C. Read User Settings #1 to #5 below carefully and change them accordingly
optional
D. You can call this script when XYplorer starts. Right-click on the XY shortcut and
paste below code towards the end in the target field:
/script="::load 'SU_Helper.xys';"
*/
//USER SETTINGS:
/*
#1. SU path (default is "<xyscripts>\SimpleUpdater.xys")
*/
$SU_File="<xyscripts>\SimpleUpdater.xys";
/*
#2. Icon when XY is already Up-to-date
> If icon is inside XYplorer's icon folder then no path is required, else specify path.
> You can simply use XY's internal buttons such as :back and :fore for #2 and #3 respectively
*/
$icon1="su1.ico";
/*
#3. Icon when an update is available
> Other details same as above
*/
$icon2="su2.ico";
/*
#4. Index of the button you placed on the Toolbar.
How to find the index?
> Right-click the button, click "Customize toolbar..."
> Next to your button label if you see something like [ctb9] your index is 9.
*/
$buttonindex=9;
/*
#5. Sound file you want to use if update is available
> Specify the path of the sound file
> If you dont want sound, leave it empty like this ""
*/
$updatesound="<xyscripts>\su.wav";
//!!!!!!!! DON'T CHANGE ANYTHING BEYOND THIS !!!!!!!!!!!!
/*Read SU file */
$SU_Orig=readfile("$SU_File");
/*Set values to strings and new strings */
$string1=<<<string1
global $last_modified, $delay, $channel, $major_changelog, $beta_changelog, $prompt, $multiple_instances, $deletion, $restart_command_line;
string1;
$newstring1=<<<newstring1
global $last_modified, $delay, $channel, $major_changelog, $beta_changelog, $prompt, $multiple_instances, $deletion, $restart_command_line;
global $checkonly, $suctb1,$suctb2,$ctbindex, $susound;
newstring1;
$string2=<<<string2
if ("$channel" == "0") {
string2;
$newstring2=<<<newstring2
$suctb1="$icon1";
$suctb2="$icon2";
$ctbindex=$buttonindex;
$susound="$updatesound";
if ("$channel" == "0") {
newstring2;
$string3=<<<string3
if ("$status" == "304") {
string3;
$newstring3=<<<newstring3
if ("$status" == "304") {
if ($checkonly==1){
ctbicon ("$suctb1",$ctbindex);
};
newstring3;
$string4=<<<string4
status "$str00200_yLb2oLZnSvh3";
end "TRUE", , "1";
};
};
string4;
$newstring4=<<<newstring4
status "$str00200_yLb2oLZnSvh3";
end "TRUE", , "1";
};
};
if ($checkonly==1) {
sound "$susound", , 0;
status "$str00500_yLb2oLZnSvh3";
$count=1;
while($count<5){
ctbicon ("$suctb1",$ctbindex);
status "$str00500_yLb2oLZnSvh3",,"alert";
wait (300);
ctbicon ("$suctb2",$ctbindex);
status "$str00500_yLb2oLZnSvh3","FF0000","alert";
wait (300);
$count++;
}
$checkonly=0;
delete "0", "0", "$temporary_path";
//button "ctb$ctbindex";
end "TRUE", , "1";
};
newstring4;
$string5=<<<string5
sub "_Terminate";
string5;
$newstring5=<<<newstring5
sub "_Terminate";
if(ctbicon(,$ctbindex)==$suctb2){
ctbicon($suctb1,$ctbindex);
};
newstring5;
$string6=<<<string6
html("http://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=8744", "85%", "85%", "$str00900_yLb2oLZnSvh3");
string6;
$newstring6=<<<newstring6
html("http://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=8744", "85%", "85%", "$str00900_yLb2oLZnSvh3");
"_CheckOnly"//#####################################################################################
global $checkonly;
$checkonly=1;
newstring6;
/*Replace strings with newstrings */
$SU_OnTheFly=replace($SU_Orig,$string1,$newstring1);
$SU_OnTheFly=replace($SU_OnTheFly,$string2,$newstring2);
$SU_OnTheFly=replace($SU_OnTheFly,$string3,$newstring3);
$SU_OnTheFly=replace($SU_OnTheFly,$string4,$newstring4);
$SU_OnTheFly=replace($SU_OnTheFly,$string5,$newstring5);
$SU_OnTheFly=replace($SU_OnTheFly,$string6,$newstring6);
/*Load script and its labels */
load $SU_OnTheFly,"_CheckOnly",s;
load $SU_OnTheFly,"_Initialize",s;
load $SU_OnTheFly,"Updates",s;
load $SU_OnTheFly,"_Terminate",s;