Skip to content
Permalink
Browse files
[JENKINS-19447] JDK installation hangs forever
  • Loading branch information
Gili Tzabari committed Sep 18, 2013
1 parent 22693ab commit 63bffae13bb503b3ffbef4df3ede99f9330bba93
Showing 1 changed file with 18 additions and 6 deletions.
@@ -224,16 +224,28 @@ I tried to locate exactly how InstallShield parses the arguments (and why it use
*/
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);
}
ArgumentListBuilder args = new ArgumentListBuilder();
args.add(jdkBundle);
assert (new File(expectedLocation).exists()) : expectedLocation
+ " must exist, otherwise /L will cause the installer to fail with error 1622";
if (isJava15() || isJava14()) {
args.add("/s","/v/qn REBOOT=ReallySuppress INSTALLDIR=\""+ expectedLocation +"\" /L \""+logFile+"\"");
// Installer uses InstallShield.
args.add("CMD.EXE", "/C");

// 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\\\"\"");
} else {
// modern version supports arguments in more sane format.
args.add("/s","/v","/qn","/L","\""+logFile+"\"","REBOOT=ReallySuppress","INSTALLDIR=\""+ expectedLocation+"\"");
// Installed uses Windows Installer (MSI)
args.add(jdkBundle, "/s", "REBOOT=ReallySuppress",
"INSTALLDIR=" + expectedLocation,
"/L \\\"" + expectedLocation + "\\jdk.exe.install.log\\\"");
}
// according to http://community.acresso.com/showthread.php?t=83301, \" is the trick to quote values with whitespaces.
// Oh Windows, oh windows, why do you have to be so difficult?
int r = launcher.launch().cmds(args).stdout(out)
.pwd(new FilePath(launcher.getChannel(), expectedLocation)).join();
if (r != 0) {

0 comments on commit 63bffae

Please sign in to comment.