提交 a98ccdff 编写于 作者: N Nicolas De Loof

[JENKINS-19447] use standard arguments to set installer log file.

Tested on a windows box to automaticaly install 1.4, 1.5, 1.6, 1.7 and 1.8 JDKs
上级 37986c03
......@@ -234,13 +234,15 @@ public class JDKInstaller extends ToolInstaller {
- http://java.sun.com/j2se/1.5.0/sdksilent.html
- http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/silent.html
*/
String logFile = jdkBundle+".install.log";
expectedLocation = expectedLocation.trim();
if (expectedLocation.endsWith("\\")) {
// Prevent a trailing slash from escaping quotes
expectedLocation = expectedLocation.substring(0, expectedLocation.length() - 1);
}
String logFile = expectedLocation + "\\jdk.exe.install.log";
ArgumentListBuilder args = new ArgumentListBuilder();
assert (new File(expectedLocation).exists()) : expectedLocation
+ " must exist, otherwise /L will cause the installer to fail with error 1622";
......@@ -248,20 +250,19 @@ public class JDKInstaller extends ToolInstaller {
// Installer uses InstallShield.
args.add("CMD.EXE", "/C");
// see http://docs.oracle.com/javase/1.5.0/docs/guide/deployment/deployment-guide/silent.html
// CMD.EXE /C must be followed by a single parameter (do not split it!)
args.add(jdkBundle + " /s /v\"/qn REBOOT=ReallySuppress INSTALLDIR=\\\""
+ expectedLocation + "\\\" /L \\\"" + expectedLocation
+ "\\jdk.exe.install.log\\\"\"");
+ expectedLocation + "\\\" /L \\\"" + logFile + "\\\"\"");
} else {
// Installed uses Windows Installer (MSI)
args.add(jdkBundle, "/s");
// Create a private JRE by omitting "PublicjreFeature"
// @see http://docs.oracle.com/javase/7/docs/webnotes/install/windows/jdk-installation-windows.html#jdk-silent-installation
args.add("ADDLOCAL=\"ToolsFeature\"");
args.add("REBOOT=ReallySuppress", "INSTALLDIR=" + expectedLocation,
"/L \\\"" + expectedLocation + "\\jdk.exe.install.log\\\"");
args.add("ADDLOCAL=\"ToolsFeature\"",
"REBOOT=ReallySuppress", "INSTALLDIR=" + expectedLocation,
"/L", logFile);
}
int r = launcher.launch().cmds(args).stdout(out)
.pwd(new FilePath(launcher.getChannel(), expectedLocation)).join();
......@@ -716,7 +717,7 @@ public class JDKInstaller extends ToolInstaller {
if (value) {
return FormValidation.ok();
} else {
return FormValidation.error(Messages.JDKInstaller_DescriptorImpl_doCheckAcceptLicense());
return FormValidation.error(Messages.JDKInstaller_DescriptorImpl_doCheckAcceptLicense());
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册