[Webfunds-commits] html/download/zip runlocal.bat run.bat

Edwin Woudt edwin@cypherpunks.ai
Fri, 25 Aug 2000 14:28:41 -0400 (AST)


edwin       00/08/25 14:28:40

  Modified:    download/zip run.bat
  Added:       download/zip runlocal.bat
  Log:
  Little more advanced windows build scripts.

Revision  Changes    Path
1.11      +87 -25    html/download/zip/run.bat

Index: run.bat
===================================================================
RCS file: /home/webfunds/cvsroot/html/download/zip/run.bat,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- run.bat	2000/08/21 18:15:30	1.10
+++ run.bat	2000/08/25 18:28:40	1.11
@@ -1,26 +1,88 @@
-rem       *DON'T* change these two, rather, create a file runlocal.bat, below
-SET   JDK=d:\Progra~1\Javasoft\jdk118
-SET SWING=d:\Progra~1\Javasoft\swing11\swingall.jar
-rem
-rem       You should set the location of the JDK and SWING in runlocal.bat
-if exist "runlocal.bat" goto :read_local
-goto :end_local
-:read_local
+@echo off
+cls
+
+
+REM Read local file if it exists
+REM --------------------------------------------------------------------
+if exist "runlocal.bat" goto :readlocal
+goto :endlocal
+:readlocal
 CALL runlocal
-:end_local
-rem
-rem       the rest shouldn't need to be set 
-# these shouldn't need to change
-SET cryptix_jars=cryptix-jce-compat.jar;cryptix-jce-api.jar;cryptix-jce-provider.jar;cryptix-openpgp.jar;Cryptix.jar
-SET sox_jars=%cryptix_jars%;SOX.jar
-SET CLASSPATH=%sox_jars%;%SWING%;WebFunds.jar;%MORE_JARS%
-rem
-MODE CON:LINES=50
-DOSKEY /i
-SET JIT=-nojit
-rem
-%JDK%\bin\java %JIT% webfunds.client.Core
-rem
-rem       warning, SOX must go first
-rem SET CLASSPATH=.;SOX.jar;WebFunds.jar;Cryptix.jar;%JDK%\lib\classes.zip;%SWING%
-rem SET PATH=%PATH%;%JDK%\bin
+:endlocal
+
+
+REM Construct basic classpath containing system jars if needed
+REM --------------------------------------------------------------------
+if "%CLASSPATH%" == "" goto :noclasspath
+goto :run
+
+:noclasspath
+REM If both CLASSPATH and JAVAHOME are not set then it's impossible to figure it out
+if "%JAVAHOME%" == "" goto :toobad
+REM Little hard assumption here, but there's no better way to get the version
+if "%SWINGHOME%" == "" goto :jdk12
+
+:jdk11
+IF "%JDK11%" == "" SET JDK11=YES
+SET CLASSPATH=%JAVAHOME%\lib\classes.zip;%SWINGHOME%\swingall.jar
+goto :run
+
+:jdk12
+IF "%JDK11%" == "" SET JDK11=NO
+SET CLASSPATH=%JAVAHOME%\jre\lib\rt.jar
+goto :run
+
+
+REM Add webfunds and cryptix jars to classpath
+REM --------------------------------------------------------------------
+:run
+IF "%JDK11%" == "YES" goto :compat
+SET WFCLASSPATH=cryptix-jce-api.jar;cryptix-jce-provider.jar;cryptix-openpgp.jar;Cryptix.jar;SOX.jar;WebFunds.jar;%CLASSPATH%
+goto :reallyrun
+
+:compat
+SET WFCLASSPATH=cryptix-jce-compat.jar;cryptix-jce-api.jar;cryptix-jce-provider.jar;cryptix-openpgp.jar;Cryptix.jar;SOX.jar;WebFunds.jar;%CLASSPATH%
+goto :reallyrun
+
+
+REM And run!
+REM --------------------------------------------------------------------
+:reallyrun
+echo WebFunds will now run. If for some reason it does not seem to work, 
+echo please change the settings in 'runlocal.bat'.
+
+if "%JAVAHOME%" == "" goto :usepath
+
+if EXIST %JAVAHOME%\bin\java.exe goto :java
+:jre
+%JAVAHOME%\bin\jre -cp %WFCLASSPATH% -Djava.compiler=NONE webfunds.client.Core
+goto :end
+:java
+%JAVAHOME%\bin\java -cp %WFCLASSPATH% -Djava.compiler=NONE webfunds.client.Core
+goto :end
+
+:usepath
+if "%JAVA%" == "" goto :noenv
+%JAVA% -cp %WFCLASSPATH% -Djava.compiler=NONE webfunds.client.Core
+goto :end
+:noenv
+java -cp %WFCLASSPATH% -Djava.compiler=NONE webfunds.client.Core
+goto :end
+
+
+REM Final messages
+REM --------------------------------------------------------------------
+:toobad
+echo.
+echo Unfortunately this doesn't work out. Please edit the file called
+echo 'runlocal.bat' and run this script again.
+pause
+goto :reallyend
+
+:end
+echo.
+echo Thanks for running WebFunds. If somehow WebFunds did not startup,
+echo please check the settings in 'runlocal.bat'. If that fails, please
+echo have a look at http://www.webfunds.org/ for support.
+
+:reallyend



1.1                  html/download/zip/runlocal.bat

Index: runlocal.bat
===================================================================
REM In this file you can specify the location of your java and swing
REM (for jdk 1.1) installation.
REM 
REM Important note: do not end directories with a trailing backslash '\'


REM JAVAHOME tells the script what the base directory of your java
REM installation is. 
REM
REM Here are some example settings, which happen to be the default 
REM directories for the JRE and JDK versions 1.1 and 1.2.
REM Choose one of the following and remove the 'rem' or create your own.

rem SET JAVAHOME=C:\Progra~1\JavaSoft\JRE\1.1
rem SET JAVAHOME=C:\Progra~1\JavaSoft\JRE\1.2
rem SET JAVAHOME=C:\jdk1.1.8
rem SET JAVAHOME=C:\jdk1.2.2


REM SWINGHOME tells the script what the base directory of your swing
REM installation is. You only need to set this if you use JDK 1.1,
REM because JDK 1.2 has built-in support for swing.
REM
REM The example below is the default installation directory for swing.
REM Remove the 'rem' and change if needed.

rem SET SWINGHOME=C:\Progra~1\Swing-1.1.1