| 15 |
|
* @return Path |
| 16 |
|
*/ |
| 17 |
|
public static File getInstallerPath() { |
| 18 |
< |
// String jarPath = Settings.class.getProtectionDomain().getCodeSource() |
| 19 |
< |
// .getLocation().getPath(); |
| 20 |
< |
// String decodedPath = null; |
| 21 |
< |
// try { |
| 22 |
< |
// decodedPath = URLDecoder.decode(jarPath, "UTF-8"); |
| 23 |
< |
// } catch (UnsupportedEncodingException e) { |
| 24 |
< |
// e.printStackTrace(); |
| 25 |
< |
// } |
| 26 |
< |
// return new File(decodedPath).getParentFile(); |
| 27 |
< |
String wd = System.getProperty("user.dir"); |
| 28 |
< |
return new File(wd); |
| 18 |
> |
if (Settings.isDebug()) { |
| 19 |
> |
String wd = System.getProperty("user.dir"); |
| 20 |
> |
return new File(wd); |
| 21 |
> |
} else { |
| 22 |
> |
String jarPath = Settings.class.getProtectionDomain() |
| 23 |
> |
.getCodeSource().getLocation().getPath(); |
| 24 |
> |
String decodedPath = null; |
| 25 |
> |
try { |
| 26 |
> |
decodedPath = URLDecoder.decode(jarPath, "UTF-8"); |
| 27 |
> |
} catch (UnsupportedEncodingException e) { |
| 28 |
> |
e.printStackTrace(); |
| 29 |
> |
} |
| 30 |
> |
return new File(decodedPath).getParentFile(); |
| 31 |
> |
} |
| 32 |
|
} |
| 33 |
|
|
| 34 |
|
/** |