Add batch files to start GUIs under Windows

Added a couple of batch files in the java GUI area so they can be used with
Windows.  Made an addition in TrickApplication.java to add the .bat suffix
to script calls when using Windows.

Fixes #47
This commit is contained in:
Alex Lin
2015-04-29 15:01:45 -05:00
parent 6aff648c0d
commit 7ecfcad90a
5 changed files with 13 additions and 3 deletions

View File

@ -725,12 +725,14 @@ public abstract class TrickApplication extends SingleFrameApplication implements
* @param arguments the parameters to pass to the application
*/
protected static void launchTrickApplication(String executable, String arguments) {
if ( System.getProperty("os.name").startsWith("Windows") ) {
executable = executable + ".bat" ;
}
try {
ProcessBuilder process = new ProcessBuilder(UIUtils.getTrickBin() +
File.separator + executable, arguments);
// TODO: Uncomment these when we move to Java 1.7 again
//process.redirectOutput(ProcessBuilder.Redirect.INHERIT);
//process.redirectError(ProcessBuilder.Redirect.INHERIT);
process.redirectOutput(ProcessBuilder.Redirect.INHERIT);
process.redirectError(ProcessBuilder.Redirect.INHERIT);
process.start();
} catch (IOException ioException) {
ioException.printStackTrace();