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

@@ -52,15 +52,17 @@ public class MungeCryptoPropertiesFilePath
FileWriter fw;
String sInput;
String sOutput;
int rc;
public static void main(String[] args)
{
MungeCryptoPropertiesFilePath p = new MungeCryptoPropertiesFilePath(args);
System.exit(p.rc);
}
MungeCryptoPropertiesFilePath(String[] args)
{
int rc = ERROR_NO_ERROR;
rc = ERROR_NO_ERROR;
fileInput = null;
fileOutput = null;
@@ -100,20 +102,48 @@ public class MungeCryptoPropertiesFilePath
{
}
}
System.exit(rc);
}
int processArgs(String[] args)
int processArgs(String[] argsOld)
{
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++)
{
log("arg[" + i + "] = " +args[i]);
@@ -250,7 +280,7 @@ public class MungeCryptoPropertiesFilePath
break;
case ERROR_MISSING_INPUT_FILE:
sMessage = "Invalid number of parameters: 2 expected";
sMessage = "Missing input file";
break;
case ERROR_OUTPUT_COPY_FAILED: