Author: nextgens Date: 2006-08-07 20:13:35 +0000 (Mon, 07 Aug 2006) New Revision: 9953
Removed: trunk/apps/new_installer/res/unix/bin/update.sh trunk/apps/new_installer/res/windows/update.cmd Modified: trunk/apps/new_installer/res/unix/bin/1run.sh trunk/apps/new_installer/res/unix/run.sh trunk/apps/new_installer/res/windows/bin/1run.cmd trunk/apps/new_installer/res/wrapper.conf Log: new installer Modified: trunk/apps/new_installer/res/unix/bin/1run.sh =================================================================== --- trunk/apps/new_installer/res/unix/bin/1run.sh 2006-08-07 20:10:57 UTC (rev 9952) +++ trunk/apps/new_installer/res/unix/bin/1run.sh 2006-08-07 20:13:35 UTC (rev 9953) @@ -61,6 +61,7 @@ echo "Downloading freenet-stable-latest.jar" java -jar bin/sha1test.jar freenet-stable-latest.jar "$DST" || exit 1 +ln -s freenet-stable-latest.jar freenet.jar echo "Downloading freenet-ext.jar" java -jar bin/sha1test.jar freenet-ext.jar "$DST" || exit 1 echo "Downloading update.sh" Deleted: trunk/apps/new_installer/res/unix/bin/update.sh =================================================================== --- trunk/apps/new_installer/res/unix/bin/update.sh 2006-08-07 20:10:57 UTC (rev 9952) +++ trunk/apps/new_installer/res/unix/bin/update.sh 2006-08-07 20:13:35 UTC (rev 9953) @@ -1,122 +0,0 @@ -#!/bin/bash -WHEREAMI="$(pwd)" -cd @path@ -echo "Updating freenet" - -# Attempt to use the auto-fetcher code, which will check the sha1sums. - -if [[ "$1" != "debug" ]] -then - THEMASK="-o /dev/null" -fi - -# see https://bugs.freenetproject.org/view.php?id=223 -# we can't afford a valid non-selfsigned SSL certificate :/ -if [[ $(wget --version | head -n1 | cut -d" " -f3 | cut -d"." -f2) -ge 10 ]] -then - NOCERT="--no-check-certificate " -fi - -if [[ ! -x "$(which wget)" ]] -then - WGET=0 - DOWNLOADER="curl --insecure -q -f -L -O " - DOWNLOADER2="curl --insecure -q -f -L -O http://downloads.freenetproject.org/alpha/freenet-stable-latest.jar" - DOWNLOADER3="curl --insecure -q -f -L -O " -else - WGET=1 - DOWNLOADER="wget $THEMASK -N " - DOWNLOADER2="wget $THEMASK -N -i freenet-stable-latest.jar.url" - DOWNLOADER3="wget $THEMASK -N -O update2.sh $NOCERT " -fi - -if [[ ! -s sha1test.jar ]] -then - for x in 1 2 3 4 5 - do - echo Downloading sha1test.jar utility jar which will download the actual update. - if [[ $WGET -eq 1 ]] - then - $DOWNLOADER $NOCERT https://emu.freenetproject.org/sha1test.jar - else - $DOWNLOADER https://emu.freenetproject.org/sha1test.jar - fi - - if [[ -s sha1test.jar ]] - then - break - fi - done - if [[ ! -s sha1test.jar ]] - then - echo Could not download Sha1Test. The servers may be offline? - exit - fi -fi - -cp freenet-stable-latest.jar freenet-stable-latest.jar.old -cp freenet-ext.jar freenet-ext.jar.old - -if java -cp sha1test.jar Sha1Test freenet-stable-latest.jar -then - echo Downloaded freenet-stable-latest.jar -else - echo Could not download new freenet-stable-latest.jar. - exit -fi - -if java -cp sha1test.jar Sha1Test freenet-ext.jar -then - echo Downloaded freenet-ext.jar -else - echo Could not download new freenet-ext.jar. - exit -fi - -if [[ ! -x "$(which cmp)" ]] -then - if [[ ! -x "$(which md5sum)" ]] - then - echo No cmp or md5sum utility detected - echo Restarting the node as we cannot tell whether we need to. - ./run.sh restart - else - echo hmmm - if [[ "$(md5sum freenet-stable-latest.jar)" != "$(md5sum freenet-stable-latest.jar.old)" ]] - then - echo Restarting node because freenet-stable-latest.jar updated. - ./run.sh restart - elif [[ "$(md5sum freenet-ext.jar)" != "$(md5sum freenet-ext.jar.old)" ]] - then - echo Restarting node because freenet-ext.jar updated. - ./run.sh restart - fi - fi -else - if cmp freenet-stable-latest.jar freenet-stable-latest.jar.old && cmp freenet-ext.jar freenet-ext.jar.old - then - echo Your node is up to date - else - echo Restarting node because freenet-stable-latest.jar or freenet-ext.jar updated. - ./run.sh restart - fi -fi - -$DOWNLOADER3 https://emu.freenetproject.org/svn/trunk/apps/installer/installclasspath/linux/update.sh -touch update.sh update2.sh -diff --brief update.sh update2.sh -if [[ $? -ne 0 ]] -then - LOCATION="$(pwd | sed -e 's/\//\\\//g')" - # we need to escape it, thanks to the_JinX for the hack - WHAT="@pa" - WHAT2="th@" - if [[ $WGET -eq 0 ]] - then - cp update.sh update2.sh - fi - cat update2.sh |sed "s/$WHAT$WHAT2/$LOCATION/" > update.sh - chmod +x update.sh -fi - -cd $WHEREAMI Modified: trunk/apps/new_installer/res/unix/run.sh =================================================================== --- trunk/apps/new_installer/res/unix/run.sh 2006-08-07 20:10:57 UTC (rev 9952) +++ trunk/apps/new_installer/res/unix/run.sh 2006-08-07 20:13:35 UTC (rev 9953) @@ -235,7 +235,7 @@ echo " $WRAPPER_CMD-$DIST_OS-universal-64" echo " $WRAPPER_CMD" echo -e "\n Let's start the node without the wrapper, you'll have to daemonize it yourself." - java -cp freenet-ext.jar:freenet-stable-latest.jar freenet.node.NodeStarter + java -cp freenet-ext.jar:freenet.jar freenet.node.NodeStarter exit 1 fi fi @@ -254,7 +254,7 @@ echo " $WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" echo " $WRAPPER_CMD" echo -e "\n Let's start the node without the wrapper, you'll have to daemonize it yourself." - java -cp freenet-ext.jar:freenet-stable-latest.jar freenet.node.NodeStarter + java -cp freenet-ext.jar:freenet.jar freenet.node.NodeStarter exit 1 fi fi Modified: trunk/apps/new_installer/res/windows/bin/1run.cmd =================================================================== --- trunk/apps/new_installer/res/windows/bin/1run.cmd 2006-08-07 20:10:57 UTC (rev 9952) +++ trunk/apps/new_installer/res/windows/bin/1run.cmd 2006-08-07 20:13:35 UTC (rev 9953) @@ -35,6 +35,7 @@ @echo "Downloading freenet-stable-latest.jar" @java -jar bin\sha1test.jar freenet-stable-latest.jar "$INSTALL_PATH" + at copy freenet-stable-latest.jar freenet.jar > NUl @echo "Downloading freenet-ext.jar" @java -jar bin\sha1test.jar freenet-ext.jar "$INSTALL_PATH" @echo "Downloading update.cmd" Deleted: trunk/apps/new_installer/res/windows/update.cmd =================================================================== --- trunk/apps/new_installer/res/windows/update.cmd 2006-08-07 20:10:57 UTC (rev 9952) +++ trunk/apps/new_installer/res/windows/update.cmd 2006-08-07 20:13:35 UTC (rev 9953) @@ -1,134 +0,0 @@ - at 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 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. -echo ----- -echo - Freenet Windows update script 1.6 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 ----- - -::Initialize some stuff -set MAGICSTRING=INDO -set RESTART=0 -set PATH=%SYSTEMROOT%\System32\;%PATH% - -::Go to our location -for %%I in (%0) do set LOCATION=%%~dpI -cd %LOCATION% - -::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 -for %%I in (%0) do set FILENAME=%%~nxI -if %FILENAME%==update.new.cmd goto updaterok - -::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 -if not exist update.new.cmd goto error1 -find "FREENET W%MAGICSTRING%WS UPDATE SCRIPT" update.new.cmd > NUL -if errorlevel 1 goto error1 - -::Check if updater has been updated -fc update.cmd update.new.cmd > nul -if not errorlevel 1 goto updaterok - -::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 -:updaterok -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 http://downloads.freenetproject.org/alpha/freenet-cvs-snapshot.jar.url -O freenet-cvs-snapshot.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 - -::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 -fc freenet-cvs-snapshot.jar.url freenet-cvs-snapshot.jar.new.url > nul -if not errorlevel 1 goto noupdate - -::New version found, check if the node is currently running -:updatefreenet -echo - New version found! -net start | find "Freenet" > NUL -if errorlevel 1 goto updatefreenet2 > NUL -set RESTART=1 -echo - Shutting down Freenet... -call stop.cmd > NUL - -:updatefreenet2 -echo - Downloading new version and updating local installation... -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.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 - -:noupdate -echo - Freenet is up to date. -goto end - -:error1 -echo - Error! Downloaded update script is invalid. Try again later. -goto end - -:error2 -echo - Error! Please run this script from a working Freenet installation. -echo ----- -pause -goto veryend - -:error3 -echo - Error! Could not download latest Freenet update information. Try again later. -goto end - -: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.bak.jar ren freenet-cvs-snapshot.bak.jar freenet-cvs-snapshot.jar -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.bak.jar del freenet-cvs-snapshot.bak.jar - -if %RESTART%==0 goto cleanup2 -echo - Restarting Freenet... -call start.cmd > NUL - -:cleanup2 -if %FILENAME%==update.new.cmd goto newend -if exist update.new.cmd del update.new.cmd -echo ----- -goto veryend - -::If this session was launched by an old updater, replace it now (and force exit, or we will leave a command promt open) -:newend -copy /Y update.new.cmd update.cmd > NUL -echo ----- -exit - -:veryend -::FREENET WINDOWS UPDATE SCRIPT Modified: trunk/apps/new_installer/res/wrapper.conf =================================================================== --- trunk/apps/new_installer/res/wrapper.conf 2006-08-07 20:10:57 UTC (rev 9952) +++ trunk/apps/new_installer/res/wrapper.conf 2006-08-07 20:13:35 UTC (rev 9953) @@ -1,7 +1,7 @@ wrapper.java.command=java wrapper.working.dir=../ wrapper.java.mainclass=freenet.node.NodeStarter -wrapper.java.classpath.1=freenet-stable-latest.jar +wrapper.java.classpath.1=freenet.jar wrapper.java.classpath.2=freenet-ext.jar wrapper.java.library.path.1=lib wrapper.java.initmemory=60
