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:
@@ -58,15 +58,17 @@ public class SetupAsWindowsService
|
||||
FileWriter fw;
|
||||
String sInstallDir;
|
||||
String sOutput;
|
||||
int rc;
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
SetupAsWindowsService p = new SetupAsWindowsService(args);
|
||||
System.exit(p.rc);
|
||||
}
|
||||
|
||||
SetupAsWindowsService(String[] args)
|
||||
{
|
||||
int rc = ERROR_NO_ERROR;
|
||||
rc = ERROR_NO_ERROR;
|
||||
|
||||
properties = new Properties();
|
||||
fileProperties = null;
|
||||
@@ -111,24 +113,47 @@ public class SetupAsWindowsService
|
||||
{
|
||||
}
|
||||
}
|
||||
System.exit(rc);
|
||||
}
|
||||
|
||||
int processArgs(String[] args)
|
||||
int processArgs(String[] argsOld)
|
||||
{
|
||||
String sProperties;
|
||||
File fileInstallDir = null;
|
||||
int i;
|
||||
int iEquals;
|
||||
String sKey;
|
||||
String sValue;
|
||||
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 (args.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]);
|
||||
|
||||
Reference in New Issue
Block a user