提交 d61538c8 编写于 作者: K kohsuke

[FIXED HUDSON-4118] Fixed a bug in JDK auto-installation to Windows with...

[FIXED HUDSON-4118] Fixed a bug in JDK auto-installation to Windows with directories with whitespaces. In 1.318.
    (<a href="https://hudson.dev.java.net/issues/show_bug.cgi?id=4118">issue 4118</a>)


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@20200 71c3de6d-444a-0410-be80-ed276b4c234a
上级 3b9b52ed
......@@ -165,7 +165,9 @@ public class JDKInstaller extends ToolInstaller {
ArgumentListBuilder args = new ArgumentListBuilder();
args.add(file.getRemote());
args.add("/s");
args.add("/v/qn REBOOT=Suppress INSTALLDIR="+normalizedPath+" /L "+logFile.getRemote());
// 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?
args.add("/v/qn REBOOT=Suppress INSTALLDIR=\\\""+normalizedPath+"\\\" /L \\\""+logFile.getRemote()+"\\\"");
if(node.createLauncher(log).launch().cmds(args).stdout(out).pwd(expectedLocation).join()!=0) {
out.println("Failed to install JDK");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册