Apache Tomcat 10.0 静默安装 [英] Apache Tomcat 10.0 Silent Installation

查看:40
本文介绍了Apache Tomcat 10.0 静默安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何在命令行上静默安装 Apache Tomcat 10?

Does anyone know how to install Apache Tomcat 10 silently on the commandline?

我试过/S 但它不起作用.似乎什么都没有运行,我也没有收到任何错误,它只是直接进入另一个命令提示符.

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.

除了将 Windows 服务设置为自动而不是手动之外,我希望所有东西都安装为默认值.

I want everything installed as default except for the windows service to be set to auto instead of manual.

推荐答案

使用 Windows 安装程序进行安装

Tomcat 的 Windows 安装程序是 NSIS 安装程序,因此它支持 标准/S 命令开关.

Installation using the Windows installer

Tomcat's Windows installer is an NSIS installer, therefore it supports the standard /S command switch.

所有其他标准 NSIS 选项也可以使用,因此如果您想将其安装在另一个文件夹中,只需在 cmd 提示符下执行:

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:

  • /? 打印一个很好的使用信息,
  • /C=config.ini,它允许在 *.ini 文件中设置其他变量.您可以设置的完整变量列表可以在 源代码中找到脚本.
  • /? 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 安装总结为:

Tomcat installation sums up to:

  • 解压目录中的文件,
  • 安装服务.

因此,您可以下载64 位 Windows zip" 并解压缩.

Therefore you can download the "64-bit Windows zip" and unpack it.

bin 文件夹中的 Tomcat10.exe 可执行文件是用于安装服务的可执行文件,它实际上是 prunsrv.您可以在其文档中找到命令行参数列表.

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.

与直接调用prunsrv相比,使用同文件夹中的service.bat脚本更容易:

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

没有 silent" 开关,但所有输出都是由脚本本身完成的,因此您可以将其注释掉.

There is no "silent" switch, but all the output is done by the script itself, so you can comment it out.

虽然 service.bat 脚本只有几个参数可用:

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_HOMECATALINA_BASEJAVA_HOMEJRE_HOME
  • 用于设置 java.endorsed.dirs 系统属性的过时 JAVA_ENDORSED_DIRS
  • SERVICE_STARTUP_MODEmanual(默认)、delayedauto 之间选择服务的启动模式,立>
  • JvmMs 以 MiB 为单位设置初始内存池大小(默认为 128),
  • JvmMx 以 MiB 为单位设置最大内存池大小(默认为 256).
  • the standard CATALINA_HOME, CATALINA_BASE, JAVA_HOME and JRE_HOME,
  • the obsolete 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).

这篇关于Apache Tomcat 10.0 静默安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆