Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cwisniew committed Oct 18, 2023
1 parent 371b1c8 commit 887c145
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/main/java/net/rptools/maptool/client/AppUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,18 +213,17 @@ public static Path getInstallDirectory() {
var path = Path.of(getAppInstallLocation());
if (MapTool.isDevelopment()) {
// remove build/classes/java
path = path.getParent().getParent().getParent().getParent();
} else {
path = path.getParent().getParent().getParent();
} else { // First try to find MapTool* directory in path
while (path != null) {
if (path.getFileName().toString().matches("(?i).*maptool.*")) {
path = path.getParent();
break;
}
path = path.getParent();
}
}
if (path == null) {
return Path.of(getAppInstallLocation());
if (path == null) { // if not found then just return the parent of the app subdir
return Path.of(getAppInstallLocation()).resolve("..").toAbsolutePath();
} else {
return path;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ public PreferencesDialog() {
}

final var installDirTextField = (JTextField) panel.getComponent("InstallDirTextField");
installDirTextField.setText(AppUtil.getAppInstallLocation());
installDirTextField.setText(AppUtil.getInstallDirectory().toString());

File appCfgFile = AppUtil.getAppCfgFile();
String copyInfo = "";
Expand Down

0 comments on commit 887c145

Please sign in to comment.