I just found that sketches compiled as 32bit or 64 bit executables will run when you click upon them but will not open using the launch command... I tried creating an executable from one of processing's sample sketches and then writing a new sketch that uses the launch command to launch this other sketch... wont work...
also tried using the Start "" "C:......" from the dos console
it tells me the file is not recognized as an executable program... yet by clicking on it it launches just fine
I also have similar files that do launch from processing3 sketches but were compiled using previous versions of processing.... I needed to make a minor change to one of my files which worked fine, but when I recreated the executable suddenly it would no longer launch...
You can duplicate this by using this code:
void setup (){
size (400,400);
exec("c:/Windows/notepad.exe");
}
void draw (){
}
this works but if you replace notepad with an executable created by processing3 it does not
if you switch the exec command for the launch() command the results are the same...
A work around example was just posted on the forum...
it worked as long as I changed their file path to this format: cd C:/Users/.... (single forward slash instead of double backwards slashes....
void setup () {
size (400, 400);
}
void draw() {
// press mouse button inside sketch window to launch external application
}
void mousePressed() {
PrintWriter output=null;
output = createWriter("myfile.bat");
output.println("cd C:\\Users\\C\\AppData\\Local\\Temp\\untitled7434504005769600387sketches\\sketch_170131a\\data\\application.windows64\\");
output.println("start ButtonDEMO.exe");
output.flush();
output.close();
output=null;
launch(sketchPath("")+"myfile.bat");
//REFERENCE: //<a href="http://stackoverflow.com/questions/33974730/processing-3-0-launch-function-doesnt-launch-my-exe" target="_blank" rel="nofollow">http://stackoverflow.com/questions/33974730/processing-3-0-launch-function-doesnt-launch-my-exe</a>
}
I'm having problems with this issue as well. The workaround of replacing the backslash characters with a slash/slashes did not work for me. Placing the exported application in the sketch folder also doesn't work.
I was able to get launch() working with compiled Processing executables by changing to their directories first then running them like below.
launch("cd C:/Sketch/application.windows64 && Sketch.exe");
That worked for me.
Most helpful comment
I was able to get launch() working with compiled Processing executables by changing to their directories first then running them like below.
launch("cd C:/Sketch/application.windows64 && Sketch.exe");