Does anyone know how to install Apache Tomcat 10 silently on the commandline?
I have tried /S and it just doesn't work. It seems like nothing is running and I get no error, it just goes directly to another command prompt.
Without any arguments the installer comes up properly.
I want everything installed as default except for the windows service to be set to auto instead of manual.
Tomcat's Windows installer is an NSIS installer, therefore it supports the standard /S command switch.
All other standard NSIS options also work, so if your want to install it in another folder, just execute in a cmd
prompt:
tomcat-<version>.exe /S /D=D:\installation path\with spaces
The only non standard command line options are:
/?
which prints a nice usage message,/C=config.ini
, which allows to set other variables in an *.ini
file. The complete list of variables you can set can be found in the source script.Tomcat installation sums up to:
Therefore you can download the "64-bit Windows zip" and unpack it.
The Tomcat10.exe
executable in the bin
folder is the executable used to install the service and it is actually a copy of prunsrv. You can find the list of command line parameters in its documentation.
Instead of calling directly prunsrv
, it is easier to use the service.bat
script in the same folder:
set "SERVICE_STARTUP_MODE=auto"
service.bat install
There is no "silent" switch, but all the output is done by the script itself, so you can comment it out.
Edit: Although the service.bat
script has only a couple of arguments available:
service.bat install/remove [service_name [--rename]] [--user username]
some parameters can be provided through environment variables:
CATALINA_HOME
, CATALINA_BASE
, JAVA_HOME
and JRE_HOME
,JAVA_ENDORSED_DIRS
to set the java.endorsed.dirs
system property,SERVICE_STARTUP_MODE
to choose the service's startup mode between manual
(default), delayed
or auto
,JvmMs
to set the initial memory pool size in MiB (default 128),JvmMx
to set the maximum memory pool size in MiB (default 256).