1. Switch CommandLauncher from a console application to a windows application so that no windows pop up during install.

2. Handle spaces in files names.
This commit is contained in:
Greg Richardson
2007-01-31 20:24:41 +00:00
parent 9dbe2a3ade
commit f357e87c11
21 changed files with 1072 additions and 425 deletions

View File

@@ -60,16 +60,16 @@ public class UpdateWarFile
String sInstallDir;
File file;
FileWriter fw;
int rc;
public static void main(String[] args)
{
UpdateWarFile p = new UpdateWarFile(args);
System.exit(p.rc);
}
UpdateWarFile(String[] args)
{
int rc = ERROR_NO_ERROR;
sInstallDir = null;
try
@@ -106,20 +106,43 @@ public class UpdateWarFile
{
}
}
System.exit(rc);
}
int processArgs(String[] args)
int processArgs(String[] argsOld)
{
File fileInstallDir = null;
int iOld;
int i;
String args[] = new String[argsOld.length];
int iNew;
log("Original arg count " + argsOld.length);
for (i = 0; i < argsOld.length; i++)
{
log("Arg " + i + " = " + argsOld[i] + "\r\n");
}
// Validate the number of parameters
if (args.length != 1)
if (args.length < 1)
{
return ERROR_INVALID_NUMBER_OF_PARAMS;
}
iNew = -1;
for (iOld = 0; iOld < argsOld.length; iOld++)
{
if (0 <= argsOld[iOld].indexOf("="))
{
iNew++;
args[iNew] = argsOld[iOld];
for (i = iOld + 1; i < argsOld.length && (-1 == argsOld[i].indexOf("=")); i++)
{
args[iNew] += " " + argsOld[i];
}
}
}
log("New arg count " + args.length);
for (i = 0; i < args.length; i++)
{
log("arg[" + i + "] = " + args[i]);
@@ -388,7 +411,7 @@ public class UpdateWarFile
sMessage = "No error";
break;
case ERROR_INVALID_NUMBER_OF_PARAMS:
sMessage = "Invalid number of parameters: 4 expected";
sMessage = "Invalid number of parameters: 1make expected";
break;
default:
sMessage = "Unknown error: " + err;