Author: nextgens Date: 2006-08-06 09:25:12 +0000 (Sun, 06 Aug 2006) New Revision: 9927
Modified: trunk/apps/installer/installclasspath/windows/update.cmd Log: new windows update script Modified: trunk/apps/installer/installclasspath/windows/update.cmd =================================================================== --- trunk/apps/installer/installclasspath/windows/update.cmd 2006-08-06 09:24:22 UTC (rev 9926) +++ trunk/apps/installer/installclasspath/windows/update.cmd 2006-08-06 09:25:12 UTC (rev 9927) @@ -2,7 +2,7 @@ ::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 it 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. -::To force a re-download of the latest Freenet.jar, simply delete freenet-cvs-snapshot.jar.url before running this script. +::To force a re-download of the latest Freenet.jar, simply delete freenet-stable-latest.jar.url before running this script. echo ----- echo - Freenet Windows update script 1.6 by Zero3Cool (zero3cool at zerosplayground.dk) echo - Freenet Windows update script 1.8 by Juiceman (juiceman69 at gmail.com) @@ -69,17 +69,17 @@ echo - Updater is up to date. echo ----- echo - Checking for Freenet updates... -if exist freenet-cvs-snapshot.jar.new.url del freenet-cvs-snapshot.jar.new.url -bin\wget.exe -o NUL --timeout=10 --waitretry=20 http://downloads.freenetproject.org/alpha/freenet-stable-latest.jar.url -O freenet-cvs-snapshot.jar.new.url +if exist freenet-stable-latest.jar.new.url del freenet-stable-latest.jar.new.url +bin\wget.exe -o NUL --timeout=10 --waitretry=20 http://downloads.freenetproject.org/alpha/freenet-stable-latest.jar.url -O freenet-stable-latest.jar.new.url -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 +if not exist freenet-stable-latest.jar.new.url goto error3 +FOR %%I IN ("%LOCATION%freenet-stable-latest.jar.url") DO if %%~zI==0 goto error3 ::Do we have something old to compare with? If not, update right away -if not exist freenet-cvs-snapshot.jar.url goto update1 +if not exist freenet-stable-latest.jar.url goto update1 ::Compare with current copy -fc freenet-cvs-snapshot.jar.url freenet-cvs-snapshot.jar.new.url > NUL +fc freenet-stable-latest.jar.url freenet-stable-latest.jar.new.url > NUL if not errorlevel 1 goto noupdate ::New version found, check if the node is currently running @@ -100,16 +100,16 @@ :update2 echo ----- echo - Downloading new version and updating local installation... -if exist freenet-cvs-snapshot.jar.bak del freenet-cvs-snapshot.jar.bak -if exist freenet-cvs-snapshot.jar ren freenet-cvs-snapshot.jar freenet-cvs-snapshot.jar.bak -bin\wget.exe -o NUL --timeout=10 --waitretry=20 -i freenet-stable-latest.jar.new.url -O freenet-cvs-snapshot.jar +if exist freenet-stable-latest.jar.bak del freenet-stable-latest.jar.bak +if exist freenet-stable-latest.jar ren freenet-stable-latest.jar freenet-stable-latest.jar.bak +bin\wget.exe -o NUL --timeout=10 --waitretry=20 -i freenet-stable-latest.jar.new.url -O freenet-stable-latest.jar -if not exist freenet-cvs-snapshot.jar goto error4 -FOR %%I IN ("%LOCATION%freenet-cvs-snapshot.jar") DO if %%~zI==0 goto error4 -java -cp lib\sha1test.jar Sha1Test freenet-cvs-snapshot.jar +if not exist freenet-stable-latest.jar goto error4 +FOR %%I IN ("%LOCATION%freenet-stable-latest.jar") DO if %%~zI==0 goto error4 +java -cp lib\sha1test.jar Sha1Test freenet-stable-latest.jar if not errorlevel 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 +if exist freenet-stable-latest.jar.url del freenet-stable-latest.jar.url +ren freenet-stable-latest.jar.new.url freenet-stable-latest.jar.url echo - Freenet-cvs-snapshot.jar verified and updated. goto end @@ -133,16 +133,16 @@ :error4 echo - Error! Freenet update failed, trying to restore backup... -if exist freenet-cvs-snapshot.jar del freenet-cvs-snapshot.jar -if exist freenet-cvs-snapshot.jar.bak ren freenet-cvs-snapshot.jar.bak freenet-cvs-snapshot.jar -if exist freenet-cvs-snapshot.jar.url del freenet-cvs-snapshot.jar.url +if exist freenet-stable-latest.jar del freenet-stable-latest.jar +if exist freenet-stable-latest.jar.bak ren freenet-stable-latest.jar.bak freenet-stable-latest.jar +if exist freenet-stable-latest.jar.url del freenet-stable-latest.jar.url goto end :end echo ----- echo - Cleaning up... -if exist freenet-cvs-snapshot.jar.new.url del freenet-cvs-snapshot.jar.new.url -if exist freenet-cvs-snapshot.jar.bak del freenet-cvs-snapshot.jar.bak +if exist freenet-stable-latest.jar.new.url del freenet-stable-latest.jar.new.url +if exist freenet-stable-latest.jar.bak del freenet-stable-latest.jar.bak if %RESTART%==0 goto cleanup2 echo - Restarting Freenet...
