Author: nextgens
Date: 2006-04-11 20:26:18 +0000 (Tue, 11 Apr 2006)
New Revision: 8522

Modified:
   trunk/apps/installer/installclasspath/windows/update.cmd
Log:
installer: new winupdate script

Version 1.3 is out:
- Fixed updater updating version information even if the update failed.
- Changed commenting to use "::" instead of ": " to make some editors
more happy.

~Zero3Cool


Modified: trunk/apps/installer/installclasspath/windows/update.cmd
===================================================================
--- trunk/apps/installer/installclasspath/windows/update.cmd    2006-04-11 
19:30:58 UTC (rev 8521)
+++ trunk/apps/installer/installclasspath/windows/update.cmd    2006-04-11 
20:26:18 UTC (rev 8522)
@@ -1,30 +1,30 @@
 @echo off
-: This script is designed for the Windows command line shell, so please don't 
put it into anything else! :)
-: If you want to debug this script by adding pauses and stuff, please do that 
from another batch file, because
-: if you modify this script in any way it will be detected as outdated and 
will be overwritten on the next run.
+::This script is designed for the Windows command line shell, so please don't 
put it into anything else! :)
+::If you want to debug this script by adding pauses and stuff, please do that 
from another batch file, because
+::if you modify this script in any way it will be detected as outdated and 
will be overwritten on the next run.
 echo -----
-echo - Freenet Windows update script 1.2 by Zero3Cool (zero3cool at 
zerosplayground.dk)
+echo - Freenet Windows update script 1.3 by Zero3Cool (zero3cool at 
zerosplayground.dk)
 echo - Thanks to search4answers, Michael Schierl and toad for help and 
feedback.
 echo - This script will automatically update your Freenet installation.
 echo - In case of an unrecoverable error, this script will pause.
 echo -----
 set MAGICSTRING=INDO

-: Go to our location
+::Go to our location
 for %%I in (%0) do set LOCATION=%%~dpI
 cd %LOCATION%

-: Check if its valid, or at least looks like it
+::Check if its valid, or at least looks like it
 if not exist freenet.ini goto error2
 if not exist bin\wget.exe goto error2
 echo - Freenet installation found at %LOCATION%
 echo -----

-: Get the filename and skip straight to the Freenet update if this is a new 
updater
+::Get the filename and skip straight to the Freenet update if this is a new 
updater
 for %%I in (%0) do set FILENAME=%%~nxI
 if %FILENAME%==update.new.cmd goto updaterok

-: Download latest updater and verify it
+::Download latest updater and verify it
 if exist update.new.cmd del update.new.cmd
 echo - Checking for updater updates...
 bin\wget.exe -o NUL 
https://emu.freenetproject.org/svn/trunk/apps/installer/installclasspath/windows/update.cmd
 -O update.new.cmd
@@ -32,17 +32,17 @@
 type update.new.cmd|find "FREENET W%MAGICSTRING%WS UPDATE SCRIPT" > NUL
 if errorlevel 1 goto error1

-: Check if updater has been updated
+::Check if updater has been updated
 fc update.cmd update.new.cmd|find "***** " > nul
 if errorlevel 1 goto updaterok

-: It has! Run new version and end self
+::It has! Run new version and end self
 echo - Updater updated, restarting update...
 echo -----
 start update.new.cmd
 goto veryend

-: Updater is up to date, check Freenet
+::Updater is up to date, check Freenet
 :updaterok
 echo - Updater is up to date.
 echo -----
@@ -52,10 +52,10 @@
 if not exist freenet-cvs-snapshot.jar.new.url goto error3
 FOR %%I IN (%LOCATION%freenet-cvs-snapshot.jar.url) DO if %%~zI==0 goto error3

-: Do we have something old to compare with? If not, update right away
+::Do we have something old to compare with? If not, update right away
 if not exist freenet-cvs-snapshot.jar.url goto updatefreenet

-: Compare with current copy
+::Compare with current copy
 fc freenet-cvs-snapshot.jar.url freenet-cvs-snapshot.jar.new.url|find "***** " 
> nul
 if errorlevel 1 goto noupdate

@@ -63,12 +63,12 @@
 echo - New version found, shutting down and updating Freenet...
 net start | find "Freenet" > NUL
 if not errorlevel 1 call stop.cmd > NUL
-if exist freenet-cvs-snapshot.jar.url del freenet-cvs-snapshot.jar.url
-ren freenet-cvs-snapshot.jar.new.url freenet-cvs-snapshot.jar.url
 if exist freenet-cvs-snapshot.jar ren freenet-cvs-snapshot.jar 
freenet-cvs-snapshot.bak.jar
-bin\wget.exe -o NUL -i freenet-cvs-snapshot.jar.url -O freenet-cvs-snapshot.jar
+bin\wget.exe -o NUL -i freenet-cvs-snapshot.jar.new.url -O 
freenet-cvs-snapshot.jar
 if not exist freenet-cvs-snapshot.jar goto error4
 FOR %%I IN (%LOCATION%freenet-cvs-snapshot.jar) DO if %%~zI==0 goto error4
+if exist freenet-cvs-snapshot.jar.url del freenet-cvs-snapshot.jar.url
+ren freenet-cvs-snapshot.jar.new.url freenet-cvs-snapshot.jar.url
 echo - Freenet updated.
 goto end

@@ -108,10 +108,10 @@
 if exist update.new.cmd del update.new.cmd
 goto veryend

-: If this session was launched by an old update, replace the original updater 
now (and force exit, or we will leave a command promt open)
+::If this session was launched by an old update, replace the original updater 
now (and force exit, or we will leave a command promt open)
 :newend
 copy /Y update.new.cmd update.cmd > NUL
 exit

 :veryend
-: FREENET WINDOWS UPDATE SCRIPT
\ No newline at end of file
+::FREENET WINDOWS UPDATE SCRIPT
\ No newline at end of file


Reply via email to