From 572d5610f25c61bd59956c5b8f749d985724189b Mon Sep 17 00:00:00 2001 From: Vhati Date: Fri, 6 Sep 2013 14:39:04 -0400 Subject: [PATCH] Added FTL launching on Linux --- src/main/java/net/vhati/modmanager/core/FTLUtilities.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/net/vhati/modmanager/core/FTLUtilities.java b/src/main/java/net/vhati/modmanager/core/FTLUtilities.java index 149f4ce..e6c707c 100644 --- a/src/main/java/net/vhati/modmanager/core/FTLUtilities.java +++ b/src/main/java/net/vhati/modmanager/core/FTLUtilities.java @@ -110,6 +110,7 @@ public class FTLUtilities { * Returns the executable that will launch FTL, or null. * * On Windows, FTLGame.exe is one dir above "resources/". + * On Linux, FTL is a script, one dir above "resources/". * On OSX, FTL.app is the grandparent dir itself (a bundle). */ public static File findGameExe( File datsDir ) { @@ -122,6 +123,13 @@ public class FTLUtilities { if ( exeFile.exists() ) result = exeFile; } } + else if ( System.getProperty("os.name").equals("Linux") ) { + File ftlDir = datsDir.getParentFile(); + if ( ftlDir != null ) { + File exeFile = new File( ftlDir, "FTL" ); + if ( exeFile.exists() ) result = exeFile; + } + } else if ( System.getProperty("os.name").contains("OS X") ) { // FTL.app/Contents/Resources/ File contentsDir = datsDir.getParentFile();