Fix linux dist

This commit is contained in:
crschnick 2022-01-31 10:38:11 -08:00
parent cb8f1239ad
commit b2af324993

View file

@ -42,16 +42,16 @@ public class BeaconServer {
return false; return false;
} }
private static Optional<Path> getPortableExecutable() { private static Optional<Path> getPortableLauncherExecutable() {
var env = System.getenv("XPIPE_HOME"); var env = System.getenv("XPIPE_HOME");
Path file = null; Path file = null;
// Prepare for invalid XPIPE_HOME path value // Prepare for invalid XPIPE_HOME path value
try { try {
if (System.getProperty("os.name").startsWith("Windows")) { if (System.getProperty("os.name").startsWith("Windows")) {
file = Path.of(env, "xpipe.exe"); file = Path.of(env, "xpipe-launcher.exe");
} else { } else {
file = Path.of(env, "xpipe"); file = Path.of(env, "xpipe-launcher");
} }
return Files.exists(file) ? Optional.of(file) : Optional.empty(); return Files.exists(file) ? Optional.of(file) : Optional.empty();
} catch (Exception ex) { } catch (Exception ex) {
@ -60,7 +60,7 @@ public class BeaconServer {
} }
public static Optional<Path> getLauncherExecutable() { public static Optional<Path> getLauncherExecutable() {
var portable = getPortableExecutable(); var portable = getPortableLauncherExecutable();
if (portable.isPresent()) { if (portable.isPresent()) {
return portable; return portable;
} }
@ -68,9 +68,9 @@ public class BeaconServer {
try { try {
Path file = null; Path file = null;
if (System.getProperty("os.name").startsWith("Windows")) { if (System.getProperty("os.name").startsWith("Windows")) {
file = Path.of(System.getenv("LOCALAPPDATA"), "X-Pipe", "xpipe.exe"); file = Path.of(System.getenv("LOCALAPPDATA"), "X-Pipe", "xpipe-launcher.exe");
} else { } else {
file = Path.of("/opt/xpipe/xpipe"); file = Path.of("/opt/xpipe/xpipe-launcher");
} }
return Files.exists(file) ? Optional.of(file) : Optional.empty(); return Files.exists(file) ? Optional.of(file) : Optional.empty();
} catch (Exception ex) { } catch (Exception ex) {
@ -84,7 +84,7 @@ public class BeaconServer {
if (System.getProperty("os.name").startsWith("Windows")) { if (System.getProperty("os.name").startsWith("Windows")) {
file = Path.of(System.getenv("LOCALAPPDATA"), "X-Pipe", "app", "xpipe.exe"); file = Path.of(System.getenv("LOCALAPPDATA"), "X-Pipe", "app", "xpipe.exe");
} else { } else {
file = Path.of("/opt/xpipe/app/bin/xpipe"); file = Path.of("/opt/xpipe/bin/xpipe");
} }
return Files.exists(file) ? Optional.of(file) : Optional.empty(); return Files.exists(file) ? Optional.of(file) : Optional.empty();
} catch (Exception ex) { } catch (Exception ex) {