ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/java/installer2/src/net/oni2/aeinstaller/backend/Paths.java
(Generate patch)

Comparing AE/installer2/src/net/oni2/aeinstaller/backend/Paths.java (file contents):
Revision 602 by alloc, Thu Jan 10 15:39:53 2013 UTC vs.
Revision 625 by alloc, Wed Jan 16 16:12:24 2013 UTC

# Line 15 | Line 15 | public class Paths {
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          /**

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)