diff --git a/src/main/java/co/casterlabs/caffeinated/updater/target/LinuxTarget.java b/src/main/java/co/casterlabs/caffeinated/updater/target/LinuxTarget.java index a958f07..f58e6b9 100644 --- a/src/main/java/co/casterlabs/caffeinated/updater/target/LinuxTarget.java +++ b/src/main/java/co/casterlabs/caffeinated/updater/target/LinuxTarget.java @@ -24,7 +24,7 @@ public List supportedTargets() { @Override public String getDownloadName() { - return String.format("Linux-%s.tar.gz", Platform.archTarget); + return String.format("Casterlabs-Caffeinated-gnulinux-%s.tar.gz", Platform.archTarget); } @Override @@ -44,8 +44,7 @@ public File getUpdaterLaunchFile() { @Override public void finalizeUpdate(UpdaterDialog dialog, File appDirectory) throws InterruptedException, IOException { - new File(appDirectory, "Casterlabs-Caffeinated").setExecutable(true); - new File(appDirectory, "runtime/bin/java").setExecutable(true); + // NOOP } } diff --git a/src/main/java/co/casterlabs/caffeinated/updater/target/MacTarget.java b/src/main/java/co/casterlabs/caffeinated/updater/target/MacTarget.java index d53ff68..2a82df4 100644 --- a/src/main/java/co/casterlabs/caffeinated/updater/target/MacTarget.java +++ b/src/main/java/co/casterlabs/caffeinated/updater/target/MacTarget.java @@ -25,7 +25,7 @@ public List supportedTargets() { @Override public String getDownloadName() { - return String.format("macOS-%s.tar.gz", Platform.archTarget); + return String.format("Casterlabs-Caffeinated-macos-%s.tar.gz", Platform.archTarget); } @Override @@ -45,27 +45,22 @@ public File getUpdaterLaunchFile() { @Override public void finalizeUpdate(UpdaterDialog dialog, File appDirectory) throws InterruptedException, IOException { - if (Platform.osDistribution == OSDistribution.MACOS) { - // Unquarantine the app on MacOS. - String app = '"' + new File(appDirectory, "Casterlabs-Caffeinated.app").getAbsolutePath() + '"'; - String command = "xattr -rd com.apple.quarantine " + app; + // Unquarantine the app on MacOS. + String app = '"' + new File(appDirectory, "Casterlabs-Caffeinated.app").getAbsolutePath() + '"'; + String command = "xattr -rd com.apple.quarantine " + app; - dialog.setStatus("Waiting for permission..."); - FastLogger.logStatic("Trying to unquarantine the app..."); + dialog.setStatus("Waiting for permission..."); + FastLogger.logStatic("Trying to unquarantine the app..."); - new ProcessBuilder() - .command( - "osascript", - "-e", - "do shell script \"" + command.replace("\"", "\\\"") + "\" with prompt \"Casterlabs Caffeinated would like to make changes.\" with administrator privileges" - ) - .inheritIO() - .start() - .waitFor(); - } - - new File(appDirectory, "Casterlabs-Caffeinated.app/Contents/MacOS/Casterlabs-Caffeinated").setExecutable(true); - new File(appDirectory, "Casterlabs-Caffeinated.app/Contents/Resources/runtime/bin/java").setExecutable(true); + new ProcessBuilder() + .command( + "osascript", + "-e", + "do shell script \"" + command.replace("\"", "\\\"") + "\" with prompt \"Casterlabs Caffeinated would like to make changes.\" with administrator privileges" + ) + .inheritIO() + .start() + .waitFor(); } } diff --git a/src/main/java/co/casterlabs/caffeinated/updater/target/WindowsTarget.java b/src/main/java/co/casterlabs/caffeinated/updater/target/WindowsTarget.java index 497e518..e423546 100644 --- a/src/main/java/co/casterlabs/caffeinated/updater/target/WindowsTarget.java +++ b/src/main/java/co/casterlabs/caffeinated/updater/target/WindowsTarget.java @@ -32,7 +32,7 @@ public List supportedTargets() { @Override public String getDownloadName() { - return "Windows-x86_64.zip"; + return "Casterlabs-Caffeinated-windows-x86_64.zip"; } @Override