}
}
// Assemble the file name
String cmdFile = configDir + File.separator + MainFrame.getCONFIG_NAME() + ".cmd";
File cmd = new File(cmdFile);
FileUtil util = new FileUtil();
// Read the parameters from the text area
String parameters = this.jTextAreaCommandLineParameters.getText();
// Insert the xplanet exectable at the beginning
String executable = MainFrame.getXPLANET_EXECUTABLE();
if (executable != null && !"".equals(executable)) {
// Check for blanks under Windows
String osName = System.getProperty("os.name");
if (osName.matches("(?i).*windows.+")) {
if (executable.contains(" ")) {
executable = "\"" + executable + "\"";
this.logger.finer("The windows executable '" + executable + "' contained blanks and where surroundet by \"");
}
}
} else {
executable = this.guessNameOfExecutable();
}
parameters = executable + " " + parameters;
// insert the downloader
String javacall = "start \"Downloader\" java -jar xplanet.jar -nogui";
parameters = javacall + "\n" + parameters;
this.logger.fine("Writing command file: " + cmdFile);
try {
util.printFile(cmdFile, parameters);
} catch (Exception ex) {
this.logger.log(Level.SEVERE, null, ex);
this.popError("Failed to write command file:\n" + cmd.getAbsolutePath() + "\n\n" + ex.getLocalizedMessage());
return;
}