anchor.diff:  if "x%1x" == "x/userx" goto runAsUser
   if "x%1x" == "x--userx" goto runAsUser
   set SERVICE_NAME=%1
  -set PR_DISPLAYNAME=Apache Tomcat %1
  +set DISPLAYNAME=Apache Tomcat %1
   shift
   if "x%1x" == "xx" goto checkServiceCmd
   goto checkUser
  
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: echo Using JAVA_HOME:        "%JAVA_HOME%"
  echo Using JRE_HOME:         "%JRE_HOME%"
  
  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%"
  
  "%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" ^
      --JvmMs 128 ^
      --JvmMx 256
  if not errorlevel 1 goto installed
  echo Failed installing '%SERVICE_NAME%' service
  goto end
  :installed
  echo The service '%SERVICE_NAME%' has been installed.
  
  :end
  