0

So I asked this question concerning how to combine 3 different applications into 1 Combining Processing Applications into 1 Big Executable?

From lurking I have learned the following methods I could go about to do this:

  1. use Java and embed my sketches in a Swing interface (rewrite programs into some complicated Java monstrosity)
  2. Rewitre code to launch separate windows using G4P http://www.lagers.org.uk/g4p/ex-windows/index.html (seems better than option 1 but still a pain in the ass because trying to write functions to get the LEAP motion api calls to work in the separate windows wont be easy)
  3. Use Open() at the end of each program to run the next program (quick and dirty, just the way I like it!)
  4. Combine all 3 into a batch file. (I dont really understand how to go about doing this but seems similar to previous option).

Now theoretically I could get more functionality from 1 and 2 (in terms of program flow and better user interface) and would probably learn more and be better off in my future efforts, however time is of the essence at the moment. Each of the programs creates csv data files from user input that I will use to create a visualization so the manner in which I get the programs to run is somewhat irrelevant at this point. Only problem is I cant get open() to work correctly. See below:

void setup() {
  size(200, 200);
}

void draw() { 
  // draw() must be present for mousePressed() to work
}

void mousePressed() {

 open("C:/Users/corbett2/Documents/Processing/test/application.windows64/test.bat");  //doesn't work
 open(new String[] { "cmd", "/c", "start", "/w",   "C:/Users/corbett2/Documents/Processing/test/application.windows64/test.bat"}); //also doesn't work

}

I've tried a bunch of different ways to use open() but it wont run the program. I'm using windows 8. I exported the application "test" which created the "test.bat" located in C:/Users/corbett2/Documents/Processing/test/application.windows64. I believe you have to export your sketch before you can try to use open() on it right? As said before, the idea here is to use a call to open() at the close of each of my 3 applications in order to run them.

So my specific questions are as follows:

  1. Which of the 4 methods I listed would you recommend I pursue for my issue? If none, please feel free to suggest something else.
  2. Will option 3 using open() work? Why or why not?
  3. Correct my open() issue.

Thanks in advance!

Community
  • 1
  • 1
NASA Intern
  • 823
  • 3
  • 11
  • 19
  • Which exact class the [Processing API](http://processing.org/reference/javadoc/core/) do the apps. extend? For e.g. are they a [`PApplet`](http://processing.org/reference/javadoc/core/processing/core/PApplet.html)? – Andrew Thompson Jan 30 '14 at 04:41
  • Uhhh not sure if I understand what you are asking.... – NASA Intern Jan 30 '14 at 16:50
  • ..Do you understand that there are two ***links*** above? Do you understand that I feel it is quite lazy to claim lack of understanding in a shorter statement than what I wrote, being vague about what you don't understand? – Andrew Thompson Jan 31 '14 at 00:40

1 Answers1

0

When I export application it creates test.exe for windows32 bit architecture (but running on 64bit OS) and then using your second case of open() works fine for me:

void mousePressed() {

 //open second window with test app running
 open("C:/Users/corbett2/Documents/Processing/test/application.windows32/test.exe");

 //this will close first window
 exit(); 

}

[but this didn't work with export to 64bit architecture (for me) so your problem should be with some settings of platform's launcher]

Anyway this approach works fine just you also need to close first window so user will not be confused.

Majlik
  • 1,082
  • 1
  • 10
  • 20
  • How do you get Processing to export .exe instead of .bat files though? – NASA Intern Jan 30 '14 at 16:49
  • [Here](http://www.processing.org/reference/environment/export.html) is official info about exporting and there are mentioned two java tools for creating `.exe` [JSmooth](http://jsmooth.sourceforge.net/) and [Launch4j](http://launch4j.sourceforge.net/) – Majlik Feb 03 '14 at 16:02