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

@@ -47,6 +47,7 @@ public class ClientKeystoreSetup
String sInstallDir;
Properties properties;
int rc;
// debug stuff
File file;
@@ -55,12 +56,12 @@ public class ClientKeystoreSetup
public static void main(String[] args)
{
ClientKeystoreSetup p = new ClientKeystoreSetup(args);
p = null;
System.exit(p.rc);
}
ClientKeystoreSetup(String[] args)
{
int rc;
rc = ERROR_NO_ERROR;
try
{
@@ -96,24 +97,53 @@ public class ClientKeystoreSetup
{
rc = ERROR_IO_EXCEPTION;
}
System.exit(rc);
}
int processArgs(String[] args)
int processArgs(String[] argsOld)
{
String sProperties;
File fileInstallDir = null;
File fileProperties = null;
FileInputStream fisProperties = 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 < 2)
if (argsOld.length < 2)
{
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] + "\r\n");
}
for (i = 0; i <= iNew; i++)
{
// is this the install dir param?
if (args[i].startsWith(INSTALL_DIR))