From 73c42567f0e3cd33cfd468f4a240d17b24e86807 Mon Sep 17 00:00:00 2001 From: Xp Date: Fri, 22 Jul 2022 12:43:20 -0700 Subject: [PATCH] Fixed updater --- .../src/main/java/gg/xp/xivsupport/gui/Update.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/launcher/src/main/java/gg/xp/xivsupport/gui/Update.java b/launcher/src/main/java/gg/xp/xivsupport/gui/Update.java index f3ae0dced8c5..9c23a635ad32 100644 --- a/launcher/src/main/java/gg/xp/xivsupport/gui/Update.java +++ b/launcher/src/main/java/gg/xp/xivsupport/gui/Update.java @@ -336,7 +336,12 @@ else if (depsFiles == null) { if (!updateTheUpdaterItself) { Runtime.getRuntime().addShutdownHook(new Thread(() -> { try { - Runtime.getRuntime().exec(Paths.get(installDir.toString(), "triggevent.exe").toString()); + if (isWindows()) { + Runtime.getRuntime().exec(Paths.get(installDir.toString(), "triggevent.exe").toString()); + } + else { + Runtime.getRuntime().exec(new String[]{"sh", Paths.get(installDir.toString(), "triggevent.sh").toString()}); + } } catch (IOException e) { e.printStackTrace(); @@ -400,4 +405,8 @@ private static String getStackTrace(final Throwable throwable) { return sw.getBuffer().toString(); } + private static boolean isWindows() { + return System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("windows"); + } + }