@echo off

if "%OS%"=="Windows_NT" @setlocal

echo.

set DEFAULT_FS_HOME=%~dp0..

if "%FIRESTORM_HOME%"=="" set FIRESTORM_HOME=%DEFAULT_FS_HOME%
set DEFAULT_FS_HOME=

if "" == "%FIRESTORM_HOME%" goto firestormHomeNotSet
if "" == "%JAVA_HOME%" goto javaHomeNotSet

rem Pick up command-line arguments
set CMD_LINE_ARGS=%1
if ""%1""=="""" goto doneStart
shift
:setupArgs
if ""%1""=="""" goto doneStart
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto setupArgs
:doneStart

%JAVA_HOME%\bin\javaw -Dfirestorm.home=%FIRESTORM_HOME% -jar %FIRESTORM_HOME%\lib\firestorm.jar %CMD_LINE_ARGS%

goto end

:javaHomeNotSet
echo Please set the JAVA_HOME environment variable.
goto end

:firestormHomeNotSet
echo Please set the FIRESTORM_HOME environment variable.
goto end

:end
