Changeset 776 for java/installer2/src/net/oni2/aeinstaller/backend
- Timestamp:
- Apr 2, 2013, 2:16:52 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/installer2/src/net/oni2/aeinstaller/backend/Paths.java
r730 r776 32 32 */ 33 33 public static File getInstallerPath() { 34 if (SettingsManager.isDebug() ) {34 if (SettingsManager.isDebug() || SettingsManager.getUseWorkingDir()) { 35 35 String wd = System.getProperty("user.dir"); 36 36 return new File(wd); 37 37 } else { 38 String jarPath = Paths.class.getProtectionDomain() 39 .getCodeSource().getLocation().getPath(); 40 String decodedPath = null; 41 try { 42 decodedPath = URLDecoder.decode(jarPath, "UTF-8"); 43 } catch (UnsupportedEncodingException e) { 44 e.printStackTrace(); 45 } 46 return new File(decodedPath).getParentFile().getParentFile(); 38 return getJarPath(); 47 39 } 40 } 41 42 /** 43 * @return Path of jar 44 */ 45 public static File getJarPath() { 46 String jarPath = Paths.class.getProtectionDomain().getCodeSource() 47 .getLocation().getPath(); 48 String decodedPath = null; 49 try { 50 decodedPath = URLDecoder.decode(jarPath, "UTF-8"); 51 } catch (UnsupportedEncodingException e) { 52 e.printStackTrace(); 53 } 54 return new File(decodedPath).getParentFile().getParentFile(); 48 55 } 49 56 … … 108 115 */ 109 116 public static File getVanillaGDF() { 110 return CaseInsensitiveFile.getCaseInsensitiveFile(getOniBasePath(), "GameDataFolder"); 117 return CaseInsensitiveFile.getCaseInsensitiveFile(getOniBasePath(), 118 "GameDataFolder"); 111 119 } 112 120
Note:
See TracChangeset
for help on using the changeset viewer.