我想以静默模式(实际上是使用Chef)安装指定版本的JDK。
我的问题是,当我添加 INSTALLDIR 参数时,Java JDK 安装失败。如果没有它,JDK 将安装在默认目录中(C:/程序文件/Java/ or C:/程序文件 (x86)/Java/).
我正在运行命令
jdk-7u79-windows-i586.exe /s INSTALLDIR="C:/java"
并且也尝试过
jdk-7u79-windows-i586.exe /s INSTALLDIR:"C:/java"
是什么让 Java 安装显示弹出窗口,其中包含我可以在 MSI 安装程序中使用的参数。
C:/java/路径是现有目录。
另外,我还找到了这个网站:https://docs.oracle.com/javase/7/docs/webnotes/install/windows/jdk-installation-windows.html https://docs.oracle.com/javase/7/docs/webnotes/install/windows/jdk-installation-windows.html您可以在其中找到 JDK 的指定参数。
我想使用 Chef 资源 windows-package 进行此安装
windows_package node['name']['JDK1.8'] do
source node['source']['JDK1.8']
installer_type :custom
action :install
options '/s INSTALLDIR=C:/java2'
end
什么使输出
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0, 42, 127], but received '1603'
---- Begin output of start "" /wait "D:\install\jdk-7u79-windows-i586.exe" /s INSTALLDIR=C:/java & exit %%ERRORLEVEL%% ----
STDOUT:
STDERR:
---- End output of start "" /wait "D:\install\jdk-7u79-windows-i586.exe" /s INSTALLDIR=C:/java & exit %%ERRORLEVEL%% ----
Ran start "" /wait "D:\install\jdk-7u79-windows-i586.exe" /s INSTALLDIR=C:/java & exit %%ERRORLEVEL%% returned 1603
我应该补充一下我不想安装JRE- 我的目标是安装 JDK。
有没有简单的方法来设置这些安装程序的安装路径静音模式?
规格:
- 厨师12.4.1
- 微软Windows 7
- 我想安装的 JDK 版本:6u35, 7u79 and 8u45.
我将不胜感激任何帮助,谢谢。