File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,19 @@ public void launch() {
2121 binary .setExecutable (true );
2222 new Thread (() -> {
2323 try {
24- ProcessBuilder pb = new ProcessBuilder (binary .getAbsolutePath ());
24+ // On Windows, copy exe to sketch folder and run from there
25+ // so DLLs copied alongside it are found
26+ File exeToRun = binary ;
27+ String osName2 = System .getProperty ("os.name" ,"" ).toLowerCase ();
28+ if (osName2 .contains ("win" )) {
29+ File exeCopy = new File (sketchFolder , binary .getName ());
30+ try {
31+ java .nio .file .Files .copy (binary .toPath (), exeCopy .toPath (),
32+ java .nio .file .StandardCopyOption .REPLACE_EXISTING );
33+ exeToRun = exeCopy ;
34+ } catch (Exception ignored ) {}
35+ }
36+ ProcessBuilder pb = new ProcessBuilder (exeToRun .getAbsolutePath ());
2537 pb .directory (sketchFolder );
2638 pb .redirectErrorStream (false );
2739 // Pass sketch folder so loadImage/loadStrings find data/ assets
You can’t perform that action at this time.
0 commit comments