SimpleUpdater

Discuss and share scripts and script files...
serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: SimpleUpdater

Post by serendipity »

Well, I mentioned in my first post that i dont mean to replicate other available beta updaters, so please don't expect it to be as good as others. And Jacky was a great scripter so i cannot match his skills. Too bad he left. :(
With that said, i am more than happy to get your feedback and the ones below seem very reasonable.
drewkeller wrote:Several improvements I can think of
  • Show change logs back to MostRecent($preset_number, $curver)
Been busy, but i know i should.
drewkeller wrote: [*]Improve the look of the changelog. Jacky's looked pretty nice. The navy on white with white on green looks.... well, ugly (sorry)
:lol: , too bad i like my colors. Good news! if you carefully look at my script they can be changed very easily. Anyway, assigned variables to all colors, so color as you please in the user defined parameters section.
drewkeller wrote: [*]The changelog does not need to say "Changelog for the latest beta" for every beta version (lies, I say, all lies).
true, should be just change log.
drewkeller wrote: [*]The changelog should use a monospace font since it is formatted with that intention (therefore is more readable monospaced). It does NOT need to be Courier New, if that's what you're trying to get away from. It's not as ugly as Comic Sans, but .... well, I'm an artist, don't get me started on fonts....
nice catch, my stylesheet had verdana by mistake, i prefer arial myself. if you like anything else, lookup arial and change it.
drewkeller wrote: [*]There actually have been a few times that I did an update and then needed to restore to my previous version. Which Jacky's script made real easy.[/list]
Yeah, no time right now. But i'll find the time to do it one day.
BTW, right now, if you want to save old betas just change xy.zip to $newver.zip.

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

Re: SimpleUpdater

Post by serendipity »

Here's version 3:
Change log:
Version 3
1) Optimized script for speed with conditional loops instead of wait(). If vbs file or output file takes longer than 10 seconds (which is unlikely) script will throw an error.
2) Update window colors could always be changed, just made them easier by assigning variables in User defined parameters section
3) Moved user defined parameter below variable $newver. Now you can change the variable $downloadfile from xy.zip to $newver.zip to keep copies of old betas.
4) Changed "Changelog for the latest beta" to simply "Change Log".
5) Stylesheet had verdana as font, changed to arial.
SimpleUpdater v3.xys
(15.77 KiB) Downloaded 346 times

Code: Select all

//SimpleUpdater v3
/*
WHY SIMPLE?
1) No configuration, just copy this script to XY's scripts folder, thats it.

HOW IT WORKS:
1) Checks for beta or official release and shows the change log and an option to update.
2) Saves current configuration.
3) Downloads the XY zip file to scripts folder, closes XY (your config is saved already) and extracts downloaded files to XY folder.
4) Restarts XY.
Notes: 
1) temp folder and vbs file is created in XY's script folder which is later deleted. (No junk left behind).
2) If you already have a temp file in xyscripts folder it will be deleted. (change the temp folder location below)
3) As before, everything works as it is, you can change paths below in "User-defined parameters" section

WHAT TO DO:
1) Copy SimpleUpdater script to XY's script folder.
2) To test paste this in address bar: ::load SimpleUpdater;

WHAT's NEW?
Version 3
1) Optimized script for speed with conditional loops instead of wait(). If vbs file or output file takes longer than 10 seconds (which is unlikely) script will throw an error.
2) Update window colors could always be changed, just made them easier by assigning variables in User defined parameters section
3) Moved user defined parameter below variable $newver. Now you can change the variable $downloadfile from xy.zip to $newver.zip to keep copies of old betas.
4) Changed "Changelog for the latest beta" to simply "Change Log".
5) Stylesheet had verdana as font, changed to arial.

Version 2
1) Option to terminate script if XYcopy is running or notify if multiple instances of current XY are running. 
  - Setting $multiInstance to 1 will:
   a) terminate XY if XYcopy is running in the current XY instance. 
   b) notify user if more than one instance of current XY is active. You can close additional instances yourself or allow script to kill them.
   c) not kill XY or XYcopy started from different location. 
  - Setting $multiInstance to 0 is for those who never run multiple instances or xycopy while updating. Script runs slightly faster in this mode (1.5 seconds).
    Note: With setting $multiInstance=0 this script cannot update XY if multiple instances of current XY are running. During update windows will show an error: Folder access denied. You can still close other instances and choose "Try again" to successfully update.
2) Now the update window displays 5 previous change logs (not just the last one). Variable $betas = number of change logs to display.

Version 1
1) Script now uses VBS script to unzip files to XY instead of unzip.exe. So no third party tools needed anymore.

*/

//Declare global variables
    global $downloadurl,$downloadpath,$downloadfile,$newver,$temp,$vbsfile, $closepids, $closepidfile,$multiInstance;

//Stop script if XY version is less than 09.60.0004
     end (<xyver> < "09.60.0004"), "This script needs XYplorer version 9.60.0004 or higher.";
     $ReadURL = readurl("http://www.xyplorer.com/xyfc/viewtopic.php?t=4&start=0&sd=d", , , 2);
//If no internet then script exits with a status message
     IF ($ReadURL==""){
                      status "No internet. Can't check for XY updates.","FF0000",alert;
                      end(1==1);                      
                      }  

//Read URL and get new version number and compare with current version
       $token=gettoken($ReadURL, 2, '<div class="codecontent">v'); 
       $newver =gettoken ($token, 1, " -"); 

     IF ($newver==<xyver>){
                        status "No updates, you have the latest version of XYplorer";
                        end(1==1);
                       }
     ELSE{
          Status "New XY version $newver available", "FF0000", "alert";     
         }      


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//User-defined Parameters
      $downloadpath="<xyscripts>";           		//Path where new update will be downloaded (Default=<xyscripts>)
      $downloadfile="$downloadpath\xy.zip";  		//File name of the downloaded file (Default=$downloadpath\xy.zip)
      $temp="<xyscripts>\temp";              		//Temporary location where unzipped contents and vbs file will be stored (and deleted thereafter) (Default=5)
      $vbsfile="$temp\unzip.vbs";            		//VBS file location (Default=<xyscripts>\temp)
      $betas=5;                              		//Number of previous change logs to display in the update window (Default=5)
      $multiInstance=1;                      		//See above (Default=1)
      $updatebuttonbg="#00CC00";             		//Update button background color
      $updatebuttontext="#FFF"; 	     		//Update button text color
      $windowbg="#FFF";		             		//Window background color
      $bodytext="#000066";		     		//Text color for beta logs
      $Officialcolor="Green";		     		//Text color for official release
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////      

//Stop if XYcopy is active
  IF (get ("XYcopy_Pending")!=0){ 
    echo "Cannot update, Copy operations pending."; 
    end 1==1;
    }

//Check if a other instances of XY are running and asks user input
  IF($multiInstance==1){    
                        Status "Checking for other XY instances", "FF0000", "progress"; 
  			$pidfile="<xyscripts>\pidfile.vbs";
  			$outpid="<xyscripts>\output.txt";
  			$closepidfile="$temp\closepidfile.vbs";


//Creates vbs script to retrieve process IDs of current XY instance and XY copy
  $pid=<<<pid
On Error Resume Next

processName = "XYplorer.exe"

QueryLine = "select * from win32_process where Name = " & """" & processName & """"

Computer = "."
Set OutFile = CreateObject("WScript.Shell")
Const ForAppending = 2
Set FileSystem = CreateObject("Scripting.FileSystemObject")
Set TextFile = FileSystem.OpenTextFile("$outpid", ForAppending, True)
'TextFile.WriteLine "Script for Win32_Process where processname=XYplorer.exe"
TextFile.WriteLine
Set WMIService = GetObject("winmgmts:\\" & Computer & "\root\cimv2")
Set Items = WMIService.ExecQuery(QueryLine, , 48)
For Each SubItems In Items
  TextFile.WriteLine "Caption: " & SubItems.Caption
  TextFile.WriteLine "CommandLine: " & SubItems.CommandLine
  TextFile.WriteLine "ProcessId: " & SubItems.ProcessId
Next

processName = "XYcopy.exe"

QueryLine = "select * from win32_process where Name = " & """" & processName & """"

Computer = "."
Set OutFile = CreateObject("WScript.Shell")
Set FileSystem = CreateObject("Scripting.FileSystemObject")
Set TextFile = FileSystem.OpenTextFile("$outpid", ForAppending, True)
'TextFile.WriteLine "Script for Win32_Process where processname=XYcopy.exe"
TextFile.WriteLine
Set WMIService = GetObject("winmgmts:\\" & Computer & "\root\cimv2")
Set Items = WMIService.ExecQuery(QueryLine, , 48)
For Each SubItems In Items
  TextFile.WriteLine "Caption: " & SubItems.Caption
  TextFile.WriteLine "CommandLine: " & SubItems.CommandLine
  TextFile.WriteLine "ProcessId: " & SubItems.ProcessId
Next

TextFile.Close

pid;
   
   writefile("$pidfile", "$pid"); //Write pid to file
   Status "pidfile.vbs created", "FF0000", "progress"; 
 
//Loop to make sure pidfile is indeed available, else break in 10 seconds
   $count=0;
   WHILE(exists($pidfile)!=1){
   wait (500);   
   Status "Waiting for pidfile.vbs", "FF0000", "progress";    
   $count++; 
   IF($count>20){      
      break;
       }
   }

   run """$pidfile""";

//Loop to make sure outpid file is indeed available, else break in 10 seconds
   $count=0;
   WHILE(exists($outpid)!=1){
   wait (500);
   Status "Waiting for output.txt", "FF0000", "progress"; 
   $count++; 
   IF($count>20){      
      break;
       }
   }
 
   $readpid= readfile("$outpid");
   
   wait (500);
   delete 0,0, $pidfile;
   delete 0,0, $outpid;

//If XYcopy (belonging to current XY) is running, the script terminates. 
   $xycopy= gettoken($readpid, 2, "<xypath>\XYcopy.exe");
   $xycopymsg="";
   IF($xycopy!=""){
      Status "WARNING!! Cannot update while XYcopy is running!", "FF0000", "alert"; 
      end 1==1, "WARNING!! Cannot update while XYcopy is running! ";
      }

//Get PIDs of all instances belonging to current XY     
   $instance=2;
   $otherinstance= gettoken($readpid, $instance, "<xy>");
   $closepids="";
   
   WHILE($otherinstance!=""){
     $otherinstance= gettoken($otherinstance,2,"ProcessId: ");
     $newpid= gettoken($otherinstance,1,"<crlf>");

//Build vbs script to terminate XY instances if user agrees to
     $buildpids=<<<buildpids

Set objShell = CreateObject("WScript.Shell") 
Set objWmi = GetObject("winmgmts:") 
strWmiq = "select * from Win32_Process where ProcessId='$newpid'" 
Set objQResult = objWmi.Execquery(strWmiq) 
For Each objProcess In objQResult 
intRet = objProcess.Terminate(1) 
Next 


buildpids;

     $closepids= "$closepids<crlf>$buildpids";    
     $instance++;
     $otherinstance= gettoken($readpid, $instance, "<xy>");            
    }

    $instance=$instance-3;
    IF($instance<1){
     break;
    }

//Message if multiple instances active
    IF($instance==1){
                    $instancemessage= "$instance more instance of current XY is running.<br><br>Close it and click 'OK' to continue updating. <br>or<br>click 'OK' anyway to kill that instance and continue updating (settings from current instance will be saved). <br>or<br>click 'Cancel' to Stop Script.";
      }
    ELSE{
          $instancemessage= "$instance more instances of current XY are running.<br><br>Close them and click 'OK' to continue updating. <br>or<br>click 'OK' anyway to kill other instances and continue updating (settings from current instance will be saved). <br>or<br>click 'Cancel' to Stop Script.";
         }


    IF (confirm ("$instancemessage")==0){
                status "XY will not update until other instances are closed.", FF0000, alert;
                 end 1==1;
      	        }


  }



//Get update info  

   $count=0;
   $betafinal="";

       WHILE($count<$betas){
// Get previous beta change log
           $newtoken= gettoken($ReadURL, $count+2, 'the new BETA');  
           $downloadurl=gettoken($newtoken, 1, '" class="postlink"><span style="font-weight: bold">No-Install Package');
           $downloadurl=gettoken($downloadurl, 2, '(2) <a href="');          
           $betapretext= gettoken($newtoken, 1, '<br /></div><br />To <span style="font-weight: bold">download');
           $betatext= gettoken($betapretext, 2, 'Change Log');
           $betatext= gettoken(gettoken($newtoken, 1, '<br /></div><br />To <span style="font-weight: bold">download'), 2, 'Change Log');
     
  		IF($betatext==""){
                     		//Download Official release
                     		$betatext= gettoken($betapretext, 2, 'XYplorer Official Release');  
                     		$betatext= gettoken($betatext, 1, 'faq.php" class="postlink">FAQ</a>');
                     		$betatext= gettoken($betatext, 1, '<br /></div></div>');
                     		$betatext= gettoken($betatext, 2, 'class="codetitle"><b>Code:</b></div><div class="codecontent">');    
                     			IF($betatext==""){
                              				break;
                              				}          
                     		$betafinal="$betafinal<br><br><b><font color=$Officialcolor>OFFICIAL RELEASE:</b><br>$betatext</font>";                     
                     		$downloadurl="http://www.xyplorer.com/download/xyplorer_full_noinstall.zip";
                     		}
  
  		ELSE {
        		$betatext= gettoken($betatext, 2, 'class="codetitle"><b>Code:</b></div><div class="codecontent">');
        		$betafinal="$betafinal<br><br><b>Change Log</b><br>$betatext";
       		     }
       			$count++;
     		 }

//Update window interface
  $Updatewindow=<<<Updatewindow

<style type="text/css" rel="stylesheet">
#mysubmit { background-color: $updatebuttonbg; border:0.01cm solid black; cursor= hand; font-size: 110%; font-family:Arial; color: $updatebuttontext; 

height:30px;
    font-weight: bold;}
#body { background-color: $windowbg; border:medium none; font-size: 75%; font-family:Arial,Helvetica;height:25px; color: $bodytext }
</style>
                      <FORM NAME="UpdateXY" ACTION="xys: "><FIELDSET>
                      <Legend><INPUT TYPE=SUBMIT title="Update to v$newver" name="submit" id="mysubmit" value="Update to v$newver">
                      </Legend>
                      <p id="body">$betafinal</p>
                     </FIELDSET>
                     </FORM>
Updatewindow;
  Status "New XY version $newver available", "FF0000", "alert";  
  $Update= html ("$Updatewindow",600,600,"Update XYplorer");


  IF ($Update Like "?submit=Update*"){
                                  sub "_downloadXY";   
                                }

   ELSE{
        status "SimpleUpdater closed", FF0000, alert;
        end(1==1);
       }



//Subscript that downloads, extracts and updates XY
"_downloadXY"
//Declare global variables
  global $downloadurl,$downloadfile,$newver,$temp,$vbsfile, $closepids, $closepidfile,$multiInstance;
    
//If temp file already exists, it will be deleted.
   IF(exists($temp)==2){
      delete (0,0,$temp);
     }

   new ("<xyscripts>\temp","dir");
   new ("<xyscripts>\temp\extract","dir");


   IF($multiInstance==1){ 
   			writefile("$closepidfile", "$closepids"); //Write pid to file
                     }



//Create vbs file
// Copies zip contents to temp\extract folder, then moves extracted files to XY
//Note: copying contents directly to XY is possible, but at the cost of user having to click "Yes to All" while copying.

  $VBSUnzip=<<<VBSUnzip

    ZipFile = "<xyscripts>\xy.zip"                                                      'name of zip file
    OutputFolder = "$temp\extract"                                                      'temp folder for unzipped files 
    XYFile="<xypath>"									'XYplorer path

    Set objShell = CreateObject( "Shell.Application" )
    Set objSource = objShell.NameSpace(ZipFile).Items()
    Set objTarget = objShell.NameSpace(OutputFolder)
    intOptions = 16
    objTarget.CopyHere objSource, intOptions

    Set objShell = CreateObject( "Shell.Application" )
    Set objSource = objShell.NameSpace(OutputFolder).Items()
    Set objTarget = objShell.NameSpace(XYFile)
    intOptions = 16
    objTarget.MoveHere objSource, intOptions


VBSUnzip;

     writefile("$vbsfile", "$VBSUnzip"); //Write vbs commands to file
     savesettings; //Save all settings
     download ($downloadurl,$downloadfile,o); //download latest XY
   
     substr $drive, <xypath>, 0, 2;
     substr $path, <xypath>, 2; 


//Run: Title > Text > Wait > Run vbs > Delete temp > Start XY
    IF($multiInstance==1){ 
     run "cmd /c title SimpleUpdater && echo Updating from <xyver> to $newver... && ping -n 5 127.0.0.1 >nul && cscript //nologo ""$closepidfile"" && cscript //nologo ""$vbsfile"" && RD /S /Q ""$temp"" && start ""XYplorer"" $drive""$path""\<xyexe>";
     }

    ELSE{
     run "cmd /c title SimpleUpdater && echo Updating from <xyver> to $newver... && ping -n 5 127.0.0.1 >nul && cscript //nologo ""$vbsfile"" && RD /S /Q ""$temp"" && start ""XYplorer"" $drive""$path""\<xyexe>";

    }


     #191; //Exit (without saving XY). Settings already saved above, no worries.


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

Re: SimpleUpdater

Post by drewkeller »

serendipity wrote:Well, I mentioned in my first post that i dont mean to replicate other available beta updaters, so please don't expect it to be as good as others.
Not replicating doesn't always mean not as good :) There's another updater script I saw that is butt-ugly coding. Yours is quite easy to follow.
serendipity wrote: :lol: , too bad i like my colors. Good news! if you carefully look at my script they can be changed very easily.
Easy, yes. Convenient, no. Maybe it would help if the script looked for settings in a separate file (w/o being dependent on it) so the main script can be updated without also having to edit it every time.
serendipity wrote:
drewkeller wrote: The changelog does not need to say "Changelog for the latest beta" for every beta version (lies, I say, all lies).
true, should be just change log.
My point was we don't need to be reminded that each one of those is a change log. In fact, I'm not sure it needs to be explicitly labeled at all :/ Pretty sure it looks like changelog without any title.
serendipity wrote:nice catch, my stylesheet had verdana by mistake, i prefer arial myself. if you like anything else, lookup arial and change it.
Arial is quite a bit more proportionalized than Verdana, so it's actually worse as far as trying to match the monospaced formatting.

I actually had to disable the removal of the temp folder because teracopy was prompting for overwriting files and that folder was missing at some point before the files could be copied (perhaps while my computer waited for me to clicky clicky.... copying files was SO like 20 microseconds ago and now they are gone)

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

Re: SimpleUpdater

Post by serendipity »

drewkeller wrote:Easy, yes. Convenient, no. Maybe it would help if the script looked for settings in a separate file (w/o being dependent on it) so the main script can be updated without also having to edit it every time.
No, I am not willing to add another file just to improve its looks. To me it defeats the idea of simple here. I'd rather add colors that are more acceptable to users, so go ahead and let me know what font, color, background looks good.
drewkeller wrote:My point was we don't need to be reminded that each one of those is a change log. In fact, I'm not sure it needs to be explicitly labeled at all :/ Pretty sure it looks like changelog without any title.
Yes, a bit redundant there.
drewkeller wrote:Arial is quite a bit more proportionalized than Verdana, so it's actually worse as far as trying to match the monospaced formatting.
I still prefer Arial, but i see Don uses Courier, so i'll stick with Courier to give users the XY feel. Tried it here, and it does look nice.

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

Re: SimpleUpdater

Post by drewkeller »

Version 3 (Drew)
1) Changed styles (somewhat based on Jacky's)
2) Changelogs only display up to your current version or the number of betas configured, whichever is fewer
3) Changelogs are in natural reading order (ascending order instead of descending)
4) The update button appears at both top and bottom of the changelog
5) The color of each changelog depends on whether it is an official or a beta version
6) Change size of window so you don't have to scroll left/right and so text isn't clumsily wrapped (theoretically, the changelogs will remain approx the same number of characters wide)
7) Add a message if the listing is truncated due to reaching max number of changes
Attachments
SimpleUpdater v3_drew.xys
(17.49 KiB) Downloaded 297 times

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

Re: SimpleUpdater

Post by serendipity »

drewkeller wrote:Version 3 (Drew)
1) Changed styles (somewhat based on Jacky's)
2) Changelogs only display up to your current version or the number of betas configured, whichever is fewer
3) Changelogs are in natural reading order (ascending order instead of descending)
4) The update button appears at both top and bottom of the changelog
5) The color of each changelog depends on whether it is an official or a beta version
6) Change size of window so you don't have to scroll left/right and so text isn't clumsily wrapped (theoretically, the changelogs will remain approx the same number of characters wide)
7) Add a message if the listing is truncated due to reaching max number of changes
Hi Drew,
Thanks for those changes but i just asked you for color suggestions, i did not expect you to take my script, change it and post it here. Not cool. I've been working on a version myself and this is kind of bummer to me. I am sorry if I am being rude, but should have asked before posting this.

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

Re: SimpleUpdater

Post by serendipity »

I'll post my version anyway.
Change log:
Version 4
1) To be consistent with forum, changed the font to Courier and color for betas is green and official is red.
2) Made a nicer looking button.
3) Script would get confused if change log did not appear on beta forum but there was a maintenance release.
4) Script additionally looks up official page for releases, this will be further improved.
SimpleUpdater v4.xys
(18.5 KiB) Downloaded 362 times

LittleBiG
Posts: 1848
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: SimpleUpdater

Post by LittleBiG »

Serendipity, develop the script further please, I always use your version. However, I had to made a modification, because the green Courier font type is almost unreadable for me. Additionaly, not the same looking on my home and work computer. So I changed Courier to Verdana,Arial,Helvetica as it was in v2. Thanks for the loop which checks the existance of files.

Filehero
Posts: 2717
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: SimpleUpdater

Post by Filehero »

serendipity wrote:I'll post my version anyway.
Change log:
Version 4
Working over here - and looks great. Good work! :)


Cheers,
Filehero

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

Re: SimpleUpdater

Post by serendipity »

LittleBiG wrote:Serendipity, develop the script further please, I always use your version. However, I had to made a modification, because the green Courier font type is almost unreadable for me. Additionaly, not the same looking on my home and work computer. So I changed Courier to Verdana,Arial,Helvetica as it was in v2. Thanks for the loop which checks the existance of files.
Sorry about the color/font, I can't make up my mind myself thats why I am giving you options to change. Each user is unique. :) I myself use Blue color and arial.
BTW, based on this research I'll use verdana as default:
http://www.surl.org/usabilitynews/41/onlinetext.asp
Conclusion sums it up nicely.

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

Re: SimpleUpdater

Post by serendipity »

Version 5
1) Reversed the logic of the script: it checks for update first and then for multiple instances. Only if an update is available it bothers about multiple instances or XYcopy running. All this is good as unnecessary vbs file and output file creation/deletion is not required unless an update becomes available.
2) The above change makes beta update checking faster.
3) Further improvements in reading from official release page.
4) Logs of maintenance release are now shown.
5) If change logs for official release are present on both beta page and official page, beta logs win.
6) In case of parsing issues and script cannot read proper info from web, script will end and show no update found.
7) Switched font back to Verdana based on some research (http://www.surl.org/usabilitynews/41/onlinetext.asp). Also, Beta logs are in blue and official logs in dark red. Of course all this can be changed to your liking in user setting parameters section.
SimpleUpdater v5.xys
(22.35 KiB) Downloaded 307 times

Pulinski
Posts: 40
Joined: 25 Nov 2007 07:46

Re: SimpleUpdater

Post by Pulinski »

Top work. Really enjoying the development of this script.
Paul Kemp
Auckland, New Zealand

highend
Posts: 14578
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: SimpleUpdater

Post by highend »

What do you think about storing the user editable variables in an .ini file instead of the source code, serendipity?

Filename: SimpleUpdater.ini

This makes some things a lot easier for the user:

- You can always use the same name for the script (without any version strings, so there is no need for the user to rename it afterwards)
- Your settings get never overwritten when upgrading to a new version of your script

A small wish:
Add a new variable called "SaveSettings". 0 = Don't save, 1 = Save them
and depending on it's value change the
savesettings; // Save all settings

to
if($SaveSettings == 1){ savesettings; }

So that the user doesn't have to touch the script every time it's updated.
One of my scripts helped you out? Please donate via Paypal

Filehero
Posts: 2717
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: SimpleUpdater

Post by Filehero »

Hmmm,

with WinXP and 11.50.0022 SimpleUpdater v5 tells my I have the latest version of XYplorer. :?:


Cheers,
Filehero

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

Re: SimpleUpdater

Post by serendipity »

highend wrote:What do you think about storing the user editable variables in an .ini file instead of the source code, serendipity?

Filename: SimpleUpdater.ini

This makes some things a lot easier for the user:

- You can always use the same name for the script (without any version strings, so there is no need for the user to rename it afterwards)
- Your settings get never overwritten when upgrading to a new version of your script

A small wish:
Add a new variable called "SaveSettings". 0 = Don't save, 1 = Save them
and depending on it's value change the
savesettings; // Save all settings

to
if($SaveSettings == 1){ savesettings; }

So that the user doesn't have to touch the script every time it's updated.
Hi, I was indeed planning to do that soon.

Post Reply