anchor.diff:  REM space for a full heap dump.
   REM JAVA_OPTS=%JAVA_OPTS% -XX:HeapDumpPath=$ES_HOME/logs/heapdump.hprof
   
  -if "%DATA_DIR%" == "" (
  -set DATA_DIR=%ES_HOME%\data
  -)
  -
  -if "%WORK_DIR%" == "" (
  -set WORK_DIR=%ES_HOME%
  -)
  -
  -if "%CONF_DIR%" == "" (
  -set CONF_DIR=%ES_HOME%\config
  -)
  -
  -if "%CONF_FILE%" == "" (
  -set CONF_FILE=%CONF_DIR%\elasticsearch.yml
  -)
  +if "%DATA_DIR%" == "" set DATA_DIR=%ES_HOME%\data
  +
  +if "%WORK_DIR%" == "" set WORK_DIR=%ES_HOME%
  +
  +if "%CONF_DIR%" == "" set CONF_DIR=%ES_HOME%\config
  +
  +if "%CONF_FILE%" == "" set CONF_FILE=%ES_HOME%\config\elasticsearch.yml
   
   set ES_CLASSPATH=%ES_CLASSPATH%;%ES_HOME%/lib/elasticsearch-%ES_VERSION%.jar;%ES_HOME%/lib/*;%ES_HOME%/lib/sigar/*
   set ES_PARAMS=-Delasticsearch;-Des.path.home="%ES_HOME%";-Des.default.config="%CONF_FILE%";-Des.default.path.home="%ES_HOME%";-Des.default.path.logs="%LOG_DIR%";-Des.default.path.data="%DATA_DIR%";-Des.default.path.work="%WORK_DIR%";-Des.default.path.conf="%CONF_DIR%"
  
positive.code: )
  
  :foundJVM
  if "%ES_MIN_MEM%" == "" (
  set ES_MIN_MEM=256m
  )
  
  if "%ES_MAX_MEM%" == "" (
  set ES_MAX_MEM=1g
  )
  
  if NOT "%ES_HEAP_SIZE%" == "" (
  set ES_MIN_MEM=%ES_HEAP_SIZE%
  set ES_MAX_MEM=%ES_HEAP_SIZE%
  )
  
  call:convertxm %ES_MIN_MEM% JVM_XMS
  call:convertxm %ES_MAX_MEM% JVM_XMX
  
negative.code: )
  "%JAVA_HOME%\bin\java" -version 2>&1 | find "64-Bit" >nul:
  
  if errorlevel 1 goto x86
  set EXECUTABLE=%ES_HOME%\bin\elasticsearch-service-x64.exe
  set SERVICE_ID=elasticsearch-service-x64
  set ARCH=64-bit
  goto checkExe
  
  :x86
  set EXECUTABLE=%ES_HOME%\bin\elasticsearch-service-x86.exe
  set SERVICE_ID=elasticsearch-service-x86
  set ARCH=32-bit
  
  :checkExe
  if EXIST "%EXECUTABLE%" goto okExe
  echo elasticsearch-service-(x86|x64).exe was not found...
  
  :okExe
  set ES_VERSION=${project.version}
  
  if "%LOG_DIR%" == "" set LOG_DIR=%ES_HOME%\logs
  
  if "x%1x" == "xx" goto displayUsage
  set SERVICE_CMD=%1
  