From 81069fbb5d1225a9f75cc3b982bbd74580a410b3 Mon Sep 17 00:00:00 2001 From: Downforce Agent Date: Wed, 8 May 2024 04:51:25 -0500 Subject: [PATCH] build changes + windows compatibility --- .idea/artifacts/firestar_jar.xml | 13 +++++++++++++ src/Gonzo.java | 12 +++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 .idea/artifacts/firestar_jar.xml diff --git a/.idea/artifacts/firestar_jar.xml b/.idea/artifacts/firestar_jar.xml new file mode 100644 index 0000000..a45ec56 --- /dev/null +++ b/.idea/artifacts/firestar_jar.xml @@ -0,0 +1,13 @@ + + + $PROJECT_DIR$/out/artifacts/firestar_jar + + + + + + + + + + \ No newline at end of file diff --git a/src/Gonzo.java b/src/Gonzo.java index 7af1d6a..caef488 100644 --- a/src/Gonzo.java +++ b/src/Gonzo.java @@ -115,7 +115,9 @@ public class Gonzo { System.out.println("Firestar is extracting " + s); consoleDisplay.append("Firestar is extracting " + s + "\n"); //Process p = Runtime.getRuntime().exec(new String[]{"bash","-c","aplay /home/bonkyboo/kittens_loop.wav"}); // DEBUG - Process p = Runtime.getRuntime().exec(new String[]{"bash","-c","cd " + System.getProperty("user.home") + "/.firestar/temp/" + ";wine ../psp2psarc.exe extract -y ../" + s}); + Process p; + if (!Main.wine) {p = Runtime.getRuntime().exec(new String[]{"bash","-c","cd " + System.getProperty("user.home") + "/.firestar/temp/" + ";wine ../psp2psarc.exe extract -y ../" + s});} + else {p = Runtime.getRuntime().exec(new String[]{"cd " + System.getProperty("user.home") + "/.firestar/temp/" + " && ../psp2psarc.exe extract -y ../" + s});} final Thread ioThread = new Thread() { @Override public void run() { @@ -215,7 +217,9 @@ public class Gonzo { try { System.out.println("Firestar is compiling the final build"); consoleDisplay.append("Firestar is compiling the final build" + "\n"); - Process p = Runtime.getRuntime().exec(new String[]{"bash","-c","cd " + System.getProperty("user.home") + "/.firestar/temp" + ";wine ../psp2psarc.exe create --skip-missing-files -j12 -a -i --input-file=list.txt -o " + oArcTarget}); + Process p; + if (!Main.wine) {p = Runtime.getRuntime().exec(new String[]{"bash","-c","cd " + System.getProperty("user.home") + "/.firestar/temp" + ";wine ../psp2psarc.exe create --skip-missing-files -j12 -a -i --input-file=list.txt -o " + oArcTarget});} + else {p = Runtime.getRuntime().exec(new String[]{"cd " + System.getProperty("user.home") + "/.firestar/temp" + " && ../psp2psarc.exe create --skip-missing-files -j12 -a -i --input-file=list.txt -o " + oArcTarget});} final Thread ioThread = new Thread() { @Override public void run() { @@ -247,7 +251,9 @@ public class Gonzo { new File(Main.outpath).mkdirs(); new File(System.getProperty("user.home") + "/.firestar/temp/" + oArcTarget).renameTo(new File(Main.outpath + oArcTarget)); try { - Process p = Runtime.getRuntime().exec(new String[]{"bash","-c","rm -rf " + System.getProperty("user.home") + "/.firestar/temp/"}); // Scary! + Process p; + if (!Main.wine) {p = Runtime.getRuntime().exec(new String[]{"bash","-c","rm -rf " + System.getProperty("user.home") + "/.firestar/temp/"});} // Scary! + else {p = Runtime.getRuntime().exec(new String[]{"rmdir " + System.getProperty("user.home") + "\\.firestar\\temp\\ /s /q"});} //new File(System.getProperty("user.home") + "/.firestar/temp/").delete(); } catch (IOException e) { System.out.println("WARNING: Temporary files may not have been properly cleared.\n" + e.getMessage());