Changeset 776 for java/installer2/src
- Timestamp:
- Apr 2, 2013, 2:16:52 AM (12 years ago)
- Location:
- java/installer2/src/net/oni2/aeinstaller
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
java/installer2/src/net/oni2/aeinstaller/AEInstaller2.java
r772 r776 116 116 117 117 boolean debug = false; 118 boolean useWd = false; 118 119 boolean noCacheUpdate = false; 119 120 boolean offline = false; … … 125 126 if (a.equalsIgnoreCase("-offline")) 126 127 offline = true; 128 if (a.equalsIgnoreCase("-usewd")) 129 useWd = true; 127 130 } 128 131 if (!debug) { … … 140 143 SettingsManager.deserializeFromFile(Paths.getSettingsFilename()); 141 144 SettingsManager.setDebug(debug); 145 SettingsManager.setUseWorkingDir(useWd); 142 146 SettingsManager.getInstance().setNoCacheUpdateMode(noCacheUpdate); 143 147 … … 257 261 try { 258 262 int x = svn.checkSVN("http://svn.aei.oni2.net", 259 new File(Paths.getPrefsPath(), "bin"));263 Paths.getJarPath()); 260 264 if (x > 0) { 261 265 // Update available or missing files -
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.