Skip to content

Commit

Permalink
Fixed updater
Browse files Browse the repository at this point in the history
  • Loading branch information
xpdota committed Jul 22, 2022
1 parent 171898b commit 73c4256
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion launcher/src/main/java/gg/xp/xivsupport/gui/Update.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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");
}

}

0 comments on commit 73c4256

Please sign in to comment.