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

2
bin/java/bat/README Normal file
View File

@ -0,0 +1,2 @@
The batch files in these directories may be used to start up some Trick GUIs on Windows machines.

View File

@ -0,0 +1,2 @@
set TRICK_HOME=%~dp0..
java -cp %TRICK_HOME%\dist\*;%TRICK_HOME%\lib\* trick.simcontrol.SimControlApplication %~1 %~2

2
bin/java/bat/sniffer.bat Normal file
View File

@ -0,0 +1,2 @@
set TRICK_HOME=%~dp0..
java -cp %TRICK_HOME%\dist\*;%TRICK_HOME%\lib\* trick.sniffer.SimSnifferApplication %*

2
bin/java/bat/tv.bat Normal file
View File

@ -0,0 +1,2 @@
set TRICK_HOME=%~dp0..
java -cp %TRICK_HOME%\dist\*;%TRICK_HOME%\lib\* trick.tv.TVApplication %~1 %~2

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();