anchor.diff:  echo Using JAVA_HOME:        "%JAVA_HOME%"
   echo Using JRE_HOME:         "%JRE_HOME%"
   
  -rem Use the environment variables as an example
  -rem Each command line option is prefixed with PR_
  +rem Set the server jvm from JAVA_HOME
  +set "JVM=%JRE_HOME%\bin\server\jvm.dll"
  +if exist "%JVM%" goto foundJvm
  +rem Set the client jvm from JAVA_HOME
  +set "JVM=%JRE_HOME%\bin\client\jvm.dll"
  +if exist "%JVM%" goto foundJvm
  +set JVM=auto
  +:foundJvm
  +echo Using JVM:              "%JVM%"
   
  -set PR_DESCRIPTION=Apache Tomcat @VERSION@ Server - http://tomcat.apache.org/
  -set "PR_INSTALL=%EXECUTABLE%"
  -set "PR_LOGPATH=%CATALINA_BASE%\logs"
  -set "PR_CLASSPATH=%CATALINA_HOME%\bin\bootstrap.jar;%CATALINA_BASE%\bin\tomcat-juli.jar;%CATALINA_HOME%\bin\tomcat-juli.jar"
  -rem Set the server jvm from JAVA_HOME
  -set "PR_JVM=%JRE_HOME%\bin\server\jvm.dll"
  -if exist "%PR_JVM%" goto foundJvm
  -rem Set the client jvm from JAVA_HOME
  -set "PR_JVM=%JRE_HOME%\bin\client\jvm.dll"
  -if exist "%PR_JVM%" goto foundJvm
  -set PR_JVM=auto
  -set PR_STDOUTPUT=auto
  -set PR_STDERROR=auto
  -:foundJvm
  -echo Using JVM:              "%PR_JVM%"
   "%EXECUTABLE%" //IS//%SERVICE_NAME% ^
  +    --Description "Apache Tomcat @VERSION@ Server - http://tomcat.apache.org/" ^
  +    --DisplayName "%DISPLAYNAME%" ^
  +    --Install "%EXECUTABLE%" ^
  +    --LogPath "%CATALINA_BASE%\logs" ^
  +    --StdOutput auto ^
  +    --StdError auto ^
  +    --Classpath "%CATALINA_HOME%\bin\bootstrap.jar;%CATALINA_BASE%\bin\tomcat-juli.jar;%CATALINA_HOME%\bin\tomcat-juli.jar" ^
  +    --Jvm "%JVM%" ^
  +    --StartMode jvm ^
  +    --StopMode jvm ^
       --StartClass org.apache.catalina.startup.Bootstrap ^
       --StopClass org.apache.catalina.startup.Bootstrap ^
       --StartParams start ^
       --StopParams stop ^
       --JvmOptions "-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\endorsed;-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties" ^
  -    --StartMode jvm ^
  -    --StopMode jvm ^
       --JvmMs 128 ^
       --JvmMx 256
   if not errorlevel 1 goto installed
   echo Failed installing '%SERVICE_NAME%' service
   goto end
   :installed
  -rem Clear the environment variables. They are not needed any more.
  -set PR_DISPLAYNAME=
  -set PR_DESCRIPTION=
  -set PR_INSTALL=
  -set PR_LOGPATH=
  -set PR_CLASSPATH=
  -set PR_JVM=
   echo The service '%SERVICE_NAME%' has been installed.
   
   :end
  
positive.code: 
  rem Set default Service name
  set SERVICE_NAME=Tomcat@VERSION_MAJOR@
  set PR_DISPLAYNAME=Apache Tomcat @VERSION_MAJOR@
  
  if "x%1x" == "xx" goto displayUsage
  set SERVICE_CMD=%1
  
negative.code: 
  :doRemove
  rem Remove the service
  echo Removing the service '%SERVICE_NAME%' ...
  echo Using CATALINA_BASE:    "%CATALINA_BASE%"
  
  "%EXECUTABLE%" //DS//%SERVICE_NAME% ^
      --LogPath "%CATALINA_BASE%\logs"
  if not errorlevel 1 goto removed
  echo Failed removing '%SERVICE_NAME%' service
  goto end
  