静默安装
可以通过以静默安装方式运行 Installation Manager
来安装 Rational® Performance Tester 产品软件包。以静默方式运行
Installation Manager 时,未提供用户界面;而是,Installation Manager
使用响应文件来输入用于安装产品软件包的命令。您还可以使用 Installation Manager 安装程序静默安装 Installation Manager。然后您可以使用该安装程序静默安装产品软件包。
以静默方式运行 Installation Manager
非常实用,在此方式下,可以使用批处理过程来通过脚本安装、更新和卸载产品软件包。
请注意,静默安装 Rational Performance Tester 软件包之前,必须安装 Installation Manager。有关安装 Installation Manager
的详细信息,请参阅管理 IBM Installation Manager。
执行静默安装时,有两项主要任务:
注:
要随 Rational Performance Tester 静默安装数据收集体系结构,必须创建其他响应文件。
- 创建响应文件。
- 以静默安装方式运行 Installation Manager。
使用 Installation Manager 创建响应文件
通过在使用 Installation Manager 或 Installation Manager 安装程序安装 Rational Performance Tester 产品软件包时记录操作,可以创建响应文件。记录响应文件时,您在
Installation Manager GUI 中所作的所有选择都存储在一个 XML 文件中。以静默方式运行
Installation Manager 时,Installation Manager 将使用该
XML 响应文件来找到包含该软件包的存储库以及选择要安装的功能部件等。
要对安装或卸载过程记录响应文件:
- 在命令行上,切换到 Installation Manager 安装目录中的 eclipse 子目录。例如:
-
cd
C:\Program Files\IBM\Installation Manager\eclipse
- 对于其他平台: cd /opt/IBM/InstallationManager/eclipse
- 在命令行中输入以下命令来启动 Installation Manager,用您自己的文件名和位置来替换响应文件和(可选)日志文件的文件名和位置:
注:
确保您输入的文件路径存在;Installation Manager 不会为响应文件和日志文件创建目录。
- 请按照“安装软件包”向导上的指示信息选择安装选项。有关详细信息,请参阅通过使用 Installation Manager GUI 安装 Rational Performance Tester。
- 单击完成,然后关闭 Installation Manager。
已创建 XML 响应文件,并已将其保存在命令指定的位置中。
创建数据收集体系结构响应文件
以下 UTF-8 文本文件(rpt_dci.rsp)必须放在操作系统的临时目录中,以在静默安装期间包含数据收集体系结构:
-V VAccessAll=true
-V VAccessLocal=false
-V VAccessCustom=false
-V VHosts=" "
注:
VHosts 必须是用逗号分隔的有效主机系统列表。
- 确定您的操作系统或登录概要文件使用的临时目录。例如,在 Windows® 上,从命令行输入 set。 此时将显示设置变量的列表。查找指定给 tmp 的值。这是静默安装例程将要查找 rpt_dci.rsp 响应文件的临时目录。
- 切换到临时目录。
- 创建名为 rpt_dci.rsp 的 UTF-8 文本文件,该文件中包含先前列出的参数。
使用 Installation Manager 安装程序记录响应文件
可以使用 Installation Manager 安装程序记录 Installation Manager 和其他产品的安装。
要记录 Installation Manager 的安装,请遵循以下步骤:
- 解压缩 Installation Manager,然后转至 InstallerImage_platform 目录。
- 要启动记录,输入 install -record <response file path and name> -skipInstall <agentDataLocation> -vmargs -Dcom.ibm.cic.agent.hidden=false
使用安装程序记录产品安装
要使用 Installation Manager 安装程序开始记录产品安装,请遵循以下步骤:
- 在已解压缩 Installation Manager 的位置转至 InstallerImage_platform 目录。
- 通过除去以下行打开 install.ini 文件: -input 和 @osgi.install.area/install.xml
- 输入以下命令:install -record <response file path and name> -skipInstall <agentDataLocation>,例如:install -record
- 启动 Installation Manager 并完成 Install Packages 向导。
以静默方式安装并运行 Installation Manager
使用 Installation Manager 安装程序安装 Installation Manager,然后使用 Installation Manager 从命令行以静默安装方式安装产品软件包。
请参阅 Installation Manager Web 站点获取关于如何以静默方式运行的附加文档。例如,从需要认证(用户标识和密码)的存储库执行静默安装。
下表描述了静默安装命令使用的参数:
参数 |
描述 |
-vm |
指定 Java™ 启动程序。在静默方式下,始终在 Windows 上使用 java.exe,在其他平台上使用 java。 |
-nosplash |
指定应该禁止出现的启动屏幕。 |
--launcher.suppressErrors |
指定应该禁止出现的 JVM 错误对话框。 |
-silent |
指定应该以静默方式运行的 Installation Manager 安装程序或 Installation Manager。 |
-input |
指定 XML 响应文件作为 Installation Manager 安装程序或 Installation Manager 的输入。响应文件包含安装程序或 Installation Manager 所运行的命令。 |
-log |
(可选)指定日志文件以记录静默安装的结果。日志文件是 XML 文件。 |
Installation Manager 安装程序和 Installation Manager 都具有初始化或 .ini 文件 silent-install.ini,其中的表中包含参数的缺省值。
Installation Manager 安装程序用于安装 Installation Manager。请遵循以下步骤静默安装 Installation Manager。
要静默安装 Installation Manager,解压缩安装程序并切换到 eclipse 子目录,然后使用以下命令:
-
installc –-launcher.ini silent-install.ini -log <log file path and name>。例如:installc --launcher.ini silent-install.ini -log c:\mylogfile.xml
- install --launcher.ini silent-install.ini -log <log file path and name>。例如,install --launcher.ini silent-install.ini -log /root/mylogs/mylogfile.xml
安装了 Installation Manager 之后,就可以使用它来安装其他产品。也可以使用 Installation Manager 安装程序安装产品。
要以静默安装方式运行 Installation Manager,请从 eclipse 子目录运行以下命令:
-
IBMIMc.exe--launcher.ini silent-install.ini -input <response file path and name> -log <log file path and name>。例如:IBMIMc.exe --launcher.ini silent-install.ini -input c:\mylog\responsefile.xml -log c:\mylog\silent_install_log.xml
- IBMIM --launcher.ini silent-install.ini -input <response file path and name> -log <log file path and name>。例如:IBMIM --launcher.ini silent-install.ini -input /root/mylog/responsefile.xml –log /root/mylog/silent_install_log.xml
如果想要使用 Installation Manager 安装程序静默安装产品,请从 eclipse 目录输入以下命令:
-
installc.exe --launcher.ini silent-install.ini -input <response file path and name> -log <log file path and name>。例如:installc --launcher.ini silent-install.ini -input c:\mylog\responsefile.xml -log c:\mylog\silent_install_log.xml
- install.exe --launcher.ini silent-install.ini -input <response file path and name> -log <log file path and name>。例如:IBMIM --launcher.ini silent-install.ini -input /root/mylog/responsefile.xml –log /root/mylog/silent_install_log.xml
Installation Manager 安装程序或 Installation Manager 以静默安装方式运行时,将读取响应文件并将日志文件写入指定的目录。虽然以静默安装方式运行时必须使用响应文件,但日志文件是可选的。该执行结果的状态为 0 表示成功,状态为非 0 则表示失败。
搜索并静默安装所有可用产品
要搜索并静默安装所有可用产品:
- 在命令行上,切换到 Installation Manager 安装目录中的 eclipse 子目录。
- 输入并运行以下命令,并且使用您选择的位置来替换响应文件或可选日志文件的位置:
-
IBMIMc.exe --launcher.ini silent-install.ini -installAll -log <log file path and name>
- IBMIM --launcher.ini silent-install.ini -installAll -log <log file path and name>
此时 Installation Manager 已知的所有可用产品都已安装。
静默安装当前已安装的所有产品的更新
要搜索并静默安装所有可用产品的更新:
- 在命令行上,切换到 Installation Manager 安装目录中的 eclipse 子目录。
- 输入并运行以下命令,并且使用您选择的位置来替换响应文件或可选日志文件的位置:
-
IBMIMc.exe --launcher.ini silent-install.ini -updateAll -log <log file path and name>
- IBMIM --launcher.ini silent-install.ini –
-updateAll -log <log file path and name>
此时 Installation Manager 已知的所有可用产品的更新都已安装。
响应文件命令
如果要使用 Installation Manager 的静默安装功能,则需要创建响应文件并在其中指定 Installation Manager 必须运行的所有命令。我们建议您通过对安装
IBM® Rational Performance Tester 软件包时执行的操作进行记录来创建响应文件。但是,也可以通过手动方式创建或编辑响应文件。
响应文件的命令分为两类:
- 首选项命令用来设置在 Installation Manager 的文件 → 首选项下找到的首选项,例如存储库位置信息。
- 静默安装命令用于模仿 Installation Manager 中的“安装软件包”向导。
静默安装首选项命令
虽然通常使用“首选项”窗口来指定首选项,但也可以在响应文件中指定首选项(标识为键)以便在静默安装期间使用。
注:
在一个响应文件中,可以指定多个首选项。
在响应文件中定义首选项时,XML 代码将类似于:
<preference
name = “the key of the preference"
value = “the value of the preference to be set">
</preference>
请使用下表来标识静默安装首选项的键以及相关的值:
键 |
值 |
注释® |
com.ibm.cic.common.core.preferences.logLocation |
指定 Installation Manager 日志文件的位置。 |
要点:
此键是可选的,并且用于进行测试和调试。如果未指定日志文件位置,则以静默方式和通过 UI 安装 Installation Manager 时将使用同一个位置。 |
com.ibm.cic.license.policy.location |
指定用于定义远程许可证策略文件所在位置的 URL。 |
|
com.ibm.cic.common.core.preferences.http.proxyEnabled |
True 或 False |
缺省值为 False。 |
com.ibm.cic.common.core.preferences.http.proxyHost |
主机名或 IP 地址 |
|
com.ibm.cic.common.core.preferences.http.proxyPort |
端口号 |
|
com.ibm.cic.common.core.preferences.http.proxyUseSocks |
True 或 False |
缺省值为 False。 |
com.ibm.cic.common.core.preferences.SOCKS.proxyHost |
主机名或 IP 地址 |
|
com.ibm.cic.common.core.preferences.SOCKS.proxyPort |
端口号 |
|
com.ibm.cic.common.core.preferences.ftp.proxyEnabled |
True 或 False |
缺省值为 False。 |
com.ibm.cic.common.core.preferences.ftp.proxyHost |
主机名或 IP 地址 |
|
com.ibm.cic.common.core.preferences.ftp.proxyPort |
端口号 |
|
com.ibm.cic.common.core.preferences.eclipseCache |
c:\IBM\common(Windows)
/opt/IBM/common(Linux®)
注:
以上路径是该首选项的缺省值;通常,安装软件包将为该首选项提供其自己的值。 |
如果您已安装了软件包,那么您无法更改该位置。 |
com.ibm.cic.agent.core.pref.offering.service.repositories. areUsed |
True 或 False |
将该首选项更改为“False”以禁用它。当该首选项为“True”时,如果已安装或更新产品,那么将搜索所有已链接的存储库。 |
com.ibm.cic.common.core.preferences. preserveDownloadedArtifacts |
True 或 False |
将该首选项更改为“False”以禁用它。当该首选项为“true”时,将软件包回滚到先前版本所必需的文件将存储到系统中。当该首选项为“false”时,将不存储这些文件。如果您不存储这些文件,那么您必须连接到初始存储库或介质以回滚。 |
静默安装命令
您可以使用以下参考表来进一步了解静默安装期间可用的响应文件命令。
响应文件命令 |
描述 |
Profile
<profile
id="the profile (package group) id"
installLocation="the install location of
the profile">
<data key="key1" value=”value1”/>
<data key="key2" value=”value2”/>
</profile> |
使用此命令可创建软件包组(或安装位置)。如果指定的软件包组已存在,则此命令不起任何作用。目前,在创建概要文件时,静默安装还将创建两个安装上下文;其中一个安装上下文用于 Eclipse,另一个用于
native。概要文件是安装位置。
您可以使用 <data> 元素来设置概要文件属性。
以下列表包含当前支持的关键字和相关的值:
- eclipseLocation 关键字指定现有的 Eclipse 位置值,例如 c:\myeclipse\eclipse。
- cic.selector.nl 关键字指定自然语言(NL)语言环境选择,例如 zh、ja 和 en。
注:
各 NL 值之间用逗号分隔。
以下列表包含当前支持的语言代码:
- 英语(en)
- 法语(fr)
- 意大利语(it)
- 简体中文(zh)
- 俄语(ru)
- 繁体中文(zh_TW)
- 繁体中文(香港)(zh_HK)
- 德语(de)
- 日语(ja)
- 波兰语(pl)
- 西班牙语(es)
- 捷克语(cs)
- 匈牙利语(hu)
- 朝鲜语(ko)
- 葡萄牙语(pt_BR)
|
Repositories
<server>
<repository location="http://example/
repository/">
<repository location="file:/C:/
repository/”>
<!—add more repositories below-->
<...>
</server> |
使用此命令来指定静默安装期间使用的存储库。使用 URL 或 UNC 路径指定远程存储库;使用目录路径指定本地存储库。 |
Install
<install>
<offering profile= "profile id"
features= "feature ids"
id= "offering id" version= "offering
version"></offering>
<!—add more offerings below>
<...>
</install> |
使用此命令来指定要安装的安装软件包。
概要文件标识必须与现有概要文件或“设置概要文件”命令创建的概要文件相匹配。
可以选择使用诸如“feature1, feature2”之类的逗号分隔列表来指定功能部件标识。如果未指定任何功能部件标识,则将安装所指定产品中的所有缺省功能部件。
版本号不是必需的。如果未指定版本,Installation Manager 将使用指定的标识安装最新的产品和任何可用的更新及修订包。
注:
即使在逗号分隔列表中未明确指定必需的功能部件,也将对它们进行安装。 |
<install modify="true"> 或 <uninstall
modify="true">(可选属性)
<uninstall modify="true">
<offering profile="profileID"
id="Id" version="Version"
features="-"/>
</uninstall> |
对安装和卸载命令使用 <install modify="true"> 属性可表示您要修改现有的安装。如果该属性未设置为 true,则缺省情况下值为 false。如果修改操作的目的只是安装附加语言包,则应该在产品功能部件标识列表中使用连字符 "-" 来表示不添加新功能部件。
要点:
您必须按示例中指定的那样指定 "modify=true" 和连字符 "-" 功能部件列表;否则,安装命令将安装产品的缺省功能部件,卸载命令将删除所有功能部件。 |
Uninstall
<uninstall>
<offering profile= "profile id"
features= "feature ids"
id= "offering id" version= "offering
version"></offering>
<!—add more offerings below>
<...>
</uninstall> |
使用此命令可指定将要卸载的软件包。
概要文件标识必须与现有概要文件或 profile 命令中指定的概要文件相匹配。此外,如果未指定任何功能部件标识,则指定产品中的所有功能部件都将被卸载;如果未指定任何产品标识,则指定概要文件中的所有已安装产品都将被卸载。 |
Rollback
<rollback>
<offering profile= "profile id"
id= "offering id"
version= "offering version">
</offering>
<!—add more offerings below
<...>
</rollback> |
使用此命令可从指定概要文件中当前已安装的版本回滚到指定的产品。您不能在回滚命令指定功能部件。 |
InstallAll
<installALL/>
注:
此命令等同于使用
–silent –installAll 。 |
使用此命令可以静默搜索并安装所有可用软件包。 |
UpdateAll
<updateALL/>
注:
此命令等同于使用
-silent -updateAll 。 |
使用此命令可以静默搜索并更新所有可用软件包。 |
License
<license policyFile=“policy file
location”/>
例如:
<license policyFile=”c:\mylicense.opt”/> |
使用此命令可生成包含许可证命令的响应文件,方法是在以记录方式启动 Installation Manager 后启动许可证向导。
在记录方式下,如果您通过许可证管理向导设置 flex 选项,则您设置的选项将记录在一个名为“license.opt”的许可证策略文件中,该文件与已生成的响应文件在同一目录中;响应文件将包含引用策略文件的许可证命令。 |
Wizard
<launcher -mode wizard -input
< response file > |
使用此命令可以 UI 方式启动 Installation Manager。UI 方式将在安装向导或卸载向导中启动 Installation Manager。但是,在这种情况下,响应文件只能包含首选项命令和安装命令,或者只能包含首选项命令和卸载命令;在 UI 方式下运行 Installation Manager 时,不能在同一个响应文件中混合使用安装和卸载命令。 |
其他响应文件属性
响应文件属性 |
描述 |
清除
<agent-input clean="true">
</agent-input> |
缺省情况下,clean="false"。Installation Manager 将使用在响应文件中指定的存储库和其他首选项以及在 Installation Manager 中设置的现有首选项。如果在响应文件和 Installation Manager 中指定了首选项,那么响应文件中的首选项将优先考虑。
如果设置为 clean="true",
Installation Manager 将使用在响应文件中指定的存储库和其他首选项;将不使用 Installation Manager 中设置的现有首选项。 |
临时
<agent-input clean="true" temporary="false">
</agent-input> |
缺省情况下,temporary 设置为“false”,并且将持久保存设置在响应文件中的首选项。当您设置 temporary="true" 时,将不会持久保存设置在响应文件中的首选项。
如果您可以将“临时”和“清除”属性一起使用,例如,如果您将“清除”设置为 true,“临时”设置为 false,那么运行静默安装后,在响应文件中指定的存储库设置将使用 Installation Manager 来覆盖在先前会话中设置的首选项。 |
许可证协议验收
<agent-input acceptLicense="false">
</agent-input> |
缺省情况下,以静默安装方式运行
Installation Manager 时,您同意接受安装软件包附带的许可协议。如果您不想要接受该许可证协议,您可以使用 <agent-input> 元素中的其他属性(<agent-input acceptLicense="false">)使静默安装操作自动失败。如果所安装的安装软件包带有必须接受的许可协议,则静默安装操作将失败。 |
参考:响应文件样本
可以使用基于 XML 的响应文件来指定预定义的信息,例如静默安装首选项、存储库位置以及安装概要文件等内容。工作小组和公司如果希望静默安装软件包并使其位置和首选项标准化,则响应文件非常实用。
响应文件样本 |
<agent-input >
<!-- add preferences -->
<preference name="com.ibm.cic.common.core.preferences. http.proxyEnabled"
value="c:/temp"/>
<!-- create the profile if it doesn't exist yet -->
<profile id="my_profile" installLocation="c:/temp/my_profile"></profile>
<server>
<repository location=
"http://a.site.com/local/products/sample/20060615_1542/repository/"></repository>
</server>
<install>
<offering profile= "my_profile" features= "core" id= "ies"
version= "3.2.0.20060615">
</offering>
</install>
</agent-input> |
静默安装日志文件
可以使用静默安装日志文件来检查静默安装会话的结果。
执行静默安装时,如果使用 -log <日志文件路径>.xml
选项指定了日志文件路径,静默安装功能将创建一个基于 XML 的日志文件,此文件记录了静默安装执行结果。
如果静默安装会话成功,则日志文件将仅包含根元素
<result> </result>。但是,如果安装期间发生了错误,则静默安装日志文件将包含带有消息的 error 元素,例如:
<result>
<error> Cannot find profile: profile id</error>
<error> some other errors</error>
</result> |
要进行详细分析,可以查看 Installation Manager
数据区中生成的日志。通过使用首选项命令,可以将数据区设置为首选位置,如响应文件主题所示。