Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 19349 invoked from network); 12 Nov 2010 15:11:37 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Nov 2010 15:11:37 -0000 Received: (qmail 5145 invoked by uid 500); 12 Nov 2010 15:12:07 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 4996 invoked by uid 500); 12 Nov 2010 15:12:07 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 4976 invoked by uid 99); 12 Nov 2010 15:12:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Nov 2010 15:12:06 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [15.216.28.36] (HELO g1t0029.austin.hp.com) (15.216.28.36) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Nov 2010 15:11:56 +0000 Received: from G5W0603.americas.hpqcorp.net (g5w0603.americas.hpqcorp.net [16.228.9.186]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by g1t0029.austin.hp.com (Postfix) with ESMTPS id 63A4338610 for ; Fri, 12 Nov 2010 15:11:34 +0000 (UTC) Received: from G6W0644.americas.hpqcorp.net (16.230.34.80) by G5W0603.americas.hpqcorp.net (16.228.9.186) with Microsoft SMTP Server (TLS) id 8.2.176.0; Fri, 12 Nov 2010 15:10:28 +0000 Received: from GVW1115EXC.americas.hpqcorp.net ([16.228.11.78]) by G6W0644.americas.hpqcorp.net ([16.230.34.80]) with mapi; Fri, 12 Nov 2010 15:10:27 +0000 From: "Bailey, Darragh" To: Ant Users List Date: Fri, 12 Nov 2010 15:10:25 +0000 Subject: RE: Apply argument wrapping with msiexec Thread-Topic: Apply argument wrapping with msiexec Thread-Index: AcuBG9nPwsIgL3kJRlq/zw9SOCbTxwAcxn7wADidc9A= Message-ID: References: <20101110211057.GA17419@nmhq.net> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org > > [1] From ProcessImpl.java version 1.32, 06/03/22, > > from my version of JDK 1.6: > >=20 > > StringBuilder cmdbuf =3D new StringBuilder(80); > > for (int i =3D 0; i < cmd.length; i++) { > > if (i > 0) { > > cmdbuf.append(' '); > > } > > String s =3D cmd[i]; > > if (s.indexOf(' ') >=3D 0 || s.indexOf('\t') >=3D 0) { > > if (s.charAt(0) !=3D '"') { > > cmdbuf.append('"'); > > cmdbuf.append(s); > > if (s.endsWith("\\")) { > > cmdbuf.append("\\"); > > } > > cmdbuf.append('"'); > > } else if (s.endsWith("\"")) { > > /* The argument has already been quoted. */ > > cmdbuf.append(s); > > } else { > > /* Unmatched quote for the argument. */ > > throw new IllegalArgumentException(); > > } > > } else { > > cmdbuf.append(s); > > } > > } >=20 > That is interesting, it makes the assumption that if the arg=20 > doesn't start with quotes and has whitespace, then it needs=20 > quoting. A simple if crude fix would be to swap the first 2 tests. >=20 > Thanks for looking into it in detail. Seems like the bug in quoting on windows via java's ProcessImpl is not new. http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=3D6550942 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=3D6468220 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=3D6511002 Doesn't seem like they are interested in fixing this one. I managed to put together a workaround that solves the problem for me Basically gives me the 8.3 path without spaces which avoids the problem alt= ogether. Not the nicest solution, but relatively quick. -- Regards, Darragh Bailey --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org