text
stringlengths
0
834k
rem
rem TITLE (Optional) Specify the title of Meecrowave window. The default
rem TITLE is Meecrowave if it's not specified.
rem Example (all one line)
rem set TITLE=Meecrowave.Cluster#1.Server#1 [%DATE% %TIME%]
rem ---------------------------------------------------------------------------
setlocal
rem Suppress Terminate batch job on CTRL+C
if not """"%1"""" == """"run"""" goto mainEntry
if ""%TEMP%"" == """" goto mainEntry
if exist ""%TEMP%\%~nx0.run"" goto mainEntry
echo Y>""%TEMP%\%~nx0.run""
if not exist ""%TEMP%\%~nx0.run"" goto mainEntry
echo Y>""%TEMP%\%~nx0.Y""
call ""%~f0"" %* <""%TEMP%\%~nx0.Y""
rem Use provided errorlevel
set RETVAL=%ERRORLEVEL%
del /Q ""%TEMP%\%~nx0.Y"" >NUL 2>&1
exit /B %RETVAL%
:mainEntry
del /Q ""%TEMP%\%~nx0.run"" >NUL 2>&1
rem Guess MEECROWAVE_HOME if not defined
set ""CURRENT_DIR=%cd%""
if not ""%MEECROWAVE_HOME%"" == """" goto gotHome
set ""MEECROWAVE_HOME=%CURRENT_DIR%""
if exist ""%MEECROWAVE_HOME%\bin\MEECROWAVE.bat"" goto okHome
cd ..
set ""MEECROWAVE_HOME=%cd%""
cd ""%CURRENT_DIR%""
:gotHome
if exist ""%MEECROWAVE_HOME%\bin\MEECROWAVE.bat"" goto okHome
echo The MEECROWAVE_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome
rem Copy MEECROWAVE_BASE from MEECROWAVE_HOME if not defined
if not ""%MEECROWAVE_BASE%"" == """" goto gotBase
set ""MEECROWAVE_BASE=%MEECROWAVE_HOME%""
:gotBase
rem Ensure that neither MEECROWAVE_HOME nor MEECROWAVE_BASE contains a semi-colon
rem as this is used as the separator in the classpath and Java provides no
rem mechanism for escaping if the same character appears in the path. Check this
rem by replacing all occurrences of ';' with '' and checking that neither
rem MEECROWAVE_HOME nor MEECROWAVE_BASE have changed
if ""%MEECROWAVE_HOME%"" == ""%MEECROWAVE_HOME:;=%"" goto homeNoSemicolon
echo Using MEECROWAVE_HOME: ""%MEECROWAVE_HOME%""
echo Unable to start as MEECROWAVE_HOME contains a semicolon (;) character
goto end
:homeNoSemicolon
if ""%MEECROWAVE_BASE%"" == ""%MEECROWAVE_BASE:;=%"" goto baseNoSemicolon
echo Using MEECROWAVE_BASE: ""%MEECROWAVE_BASE%""
echo Unable to start as MEECROWAVE_BASE contains a semicolon (;) character
goto end
:baseNoSemicolon
rem Ensure that any user defined CLASSPATH variables are not used on startup,
rem but allow them to be specified in setenv.bat, in rare case when it is needed.
set CLASSPATH=
rem Get standard environment variables
if not exist ""%MEECROWAVE_BASE%\bin\setenv.bat"" goto checkSetenvHome
call ""%MEECROWAVE_BASE%\bin\setenv.bat""
goto setenvDone
:checkSetenvHome
if exist ""%MEECROWAVE_HOME%\bin\setenv.bat"" call ""%MEECROWAVE_HOME%\bin\setenv.bat""
:setenvDone
rem Get standard Java environment variables
rem In debug mode we need a real JDK (JAVA_HOME)
if """"%1"""" == """"debug"""" goto needJavaHome
rem Otherwise either JRE or JDK are fine
if not ""%JRE_HOME%"" == """" goto gotJreHome
if not ""%JAVA_HOME%"" == """" goto gotJavaHome
echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
echo At least one of these environment variable is needed to run this program
goto exit
:needJavaHome
rem Check if we have a usable JDK
if ""%JAVA_HOME%"" == """" goto noJavaHome
if not exist ""%JAVA_HOME%\bin\java.exe"" goto noJavaHome
if not exist ""%JAVA_HOME%\bin\javaw.exe"" goto noJavaHome
if not exist ""%JAVA_HOME%\bin\jdb.exe"" goto noJavaHome
if not exist ""%JAVA_HOME%\bin\javac.exe"" goto noJavaHome
set ""JRE_HOME=%JAVA_HOME%""
goto okJava
:noJavaHome
echo The JAVA_HOME environment variable is not defined correctly.
echo It is needed to run this program in debug mode.
echo NB: JAVA_HOME should point to a JDK not a JRE.
goto exit