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 ServerKeystoreSetup
String sInstallDir;
Properties properties;
int rc;
// debug stuff
File file;
@@ -55,26 +56,18 @@ public class ServerKeystoreSetup
public static void main(String[] args)
{
ServerKeystoreSetup p = new ServerKeystoreSetup(args);
p = null;
System.exit(p.rc);
}
ServerKeystoreSetup(String[] args)
{
int rc;
rc = ERROR_NO_ERROR;
try
{
// DEBUG STUFF
file = new File("c:\\test2.log");
fw = new FileWriter(file);
log("Here we go again: " + args.length);
for (int i = 0; i < args.length; i++)
{
log("Arg " + i + " = " + args[i] + "\r\n");
}
// DEBUG STUFF
// Process the input params
if (ERROR_NO_ERROR == (rc = processArgs(args)))
{
@@ -96,16 +89,24 @@ public class ServerKeystoreSetup
{
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)
@@ -113,7 +114,28 @@ public class ServerKeystoreSetup
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))