Author: nextgens Date: 2006-07-21 11:41:24 +0000 (Fri, 21 Jul 2006) New Revision: 9692
Modified: trunk/apps/installer/installclasspath/windows/update.cmd Log: installer: update update.cmd according to #473 ; thanks to Juiceman for the patch :) ... We won't update freenet-ext for the time beeing, I'm planning to refactor it soon Modified: trunk/apps/installer/installclasspath/windows/update.cmd =================================================================== --- trunk/apps/installer/installclasspath/windows/update.cmd 2006-07-21 09:41:06 UTC (rev 9691) +++ trunk/apps/installer/installclasspath/windows/update.cmd 2006-07-21 11:41:24 UTC (rev 9692) @@ -25,9 +25,9 @@ echo - Freenet installation found at %LOCATION% echo ----- -if not exist wrapper.conf.bak copy wrapper.conf wrapper.conf.bak +if not exist wrapper.conf.bak copy wrapper.conf wrapper.conf.bak > NUL @del wrapper.conf - at copy wrapper.conf.bak wrapper.conf + at copy wrapper.conf.bak wrapper.conf >NUL ::Get the filename and skip straight to the Freenet update if this is a new updater for %%I in (%0) do set FILENAME=%%~nxI @@ -53,6 +53,9 @@ ::Updater is up to date, check Freenet :updaterok +::Check for sha1test and download if needed. +if not exist lib\sha1test.jar bin\wget.exe -o NUL https://emu.freenetproject.org/sha1test.jar -O lib\sha1test.jar +if not errorlevel 0 goto error3 echo - Updater is up to date. echo ----- echo - Checking for Freenet updates... @@ -62,30 +65,37 @@ 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 - +if not exist freenet-cvs-snapshot.jar.url goto update1 ::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 +:update1 echo - New version found! +:safetycheck net start | find "Freenet" > NUL -if errorlevel 1 goto updatefreenet2 > NUL +if errorlevel 1 goto update2 > NUL set RESTART=1 echo - Shutting down Freenet... call stop.cmd > NUL +echo - If you see an error message about +echo - "The service could not be controlled in its present state." +echo - Please ignore, it is a side effect of a work-around +echo - to make sure the node is stopped before we copy files. +goto safetycheck -:updatefreenet2 +:update2 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 +java -cp lib\sha1test.jar Sha1Test freenet-cvs-snapshot.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 -echo - Freenet updated. +echo - Freenet verified and updated. goto end :noupdate @@ -128,7 +138,7 @@ 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) +::If this session was launched by an old updater, replace it now (and force exit, or we will leave a command prompt open) :newend copy /Y update.new.cmd update.cmd > NUL echo -----
