From: Ben Soares Date: Tue, 29 Oct 2024 18:41:19 +0000 (+0000) Subject: JAL-4477 Change to Files.createDirectories(). Adding sun.jnu.encoding=UTF-8 to instal... X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=da07cafbab76f7f98a3a55a9177192e043a6817f;p=jalview.git JAL-4477 Change to Files.createDirectories(). Adding sun.jnu.encoding=UTF-8 to install4j and getdown launches --- diff --git a/getdown/lib/getdown-core.jar b/getdown/lib/getdown-core.jar index c145270..5d149ac 100644 Binary files a/getdown/lib/getdown-core.jar and b/getdown/lib/getdown-core.jar differ diff --git a/getdown/lib/getdown-launcher-local.jar b/getdown/lib/getdown-launcher-local.jar index a2d604e..28781a0 100644 Binary files a/getdown/lib/getdown-launcher-local.jar and b/getdown/lib/getdown-launcher-local.jar differ diff --git a/getdown/lib/getdown-launcher.jar b/getdown/lib/getdown-launcher.jar index 1676032..fd2b05f 100644 Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ diff --git a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Application.java b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Application.java index 047269d..5378f62 100644 --- a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Application.java +++ b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Application.java @@ -1099,6 +1099,7 @@ public class Application addSystemPropertyIfNotNull(args, "installer.logfile"); addSystemPropertyIfNotNull(args, "installer.logfile_append"); addSystemPropertyIfNotNull(args, "installer.extrainfo"); + addSystemPropertyIfNotNull(args, "sun.jnu.encoding"); // backward compatibility (old getdown-launcher.jar) args.add("-Dgetdownappdir=" + getAppDir()); diff --git a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/EnvConfig.java b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/EnvConfig.java index bdaba7a..7c4f669 100644 --- a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/EnvConfig.java +++ b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/EnvConfig.java @@ -411,7 +411,17 @@ public final class EnvConfig { if (setUserAppDirPath.startsWith("~" + FS)) { setUserAppDirPath = home + setUserAppDirPath.substring(1); } - appDataPath = setUserAppDirPath.replaceAll("%u", System.getProperty("user.name")).replaceAll("%h", home); + String username = System.getProperty("user.name"); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < username.length(); i++) { + String code = Integer.toHexString(Character.codePointAt(username, i)); + if (i > 0) { + sb.append("-"); + } + sb.append(code); + } + String asciiname = sb.toString(); + appDataPath = setUserAppDirPath.replaceAll("%u", username).replaceAll("%h", home).replaceAll("%U", asciiname); addHome = false; } diff --git a/getdown/src/getdown/core/src/main/java/jalview/util/FileUtils.java b/getdown/src/getdown/core/src/main/java/jalview/util/FileUtils.java index 2681de6..ce74673 100644 --- a/getdown/src/getdown/core/src/main/java/jalview/util/FileUtils.java +++ b/getdown/src/getdown/core/src/main/java/jalview/util/FileUtils.java @@ -390,7 +390,7 @@ public class FileUtils { try { - Files.createDirectory(getCanonicalPath(file)); + Files.createDirectories(getCanonicalPath(file)); return file.exists(); } catch (IOException e) { diff --git a/gradle.properties b/gradle.properties index 823264c..7320a42 100644 --- a/gradle.properties +++ b/gradle.properties @@ -130,12 +130,12 @@ flexmark_css = utils/doc/github.css channel_properties_dir = utils/channels channel_props = channel.props -install4j_home_dir = ~/buildtools/install4j10 +install4j_home_dir = ~/buildtools/install4j11 install4j_copyright_message = ... install4j_bundle_id = org.jalview.jalview-desktop install4j_utils_dir = utils/install4j install4j_images_dir = utils/install4j -install4j_template = install4j10_template.install4j +install4j_template = install4j11_template.install4j install4j_info_plist_file_associations = file_associations_auto-Info_plist.xml install4j_installer_file_associations = file_associations_auto-install4j10.xml #install4j_DMG_uninstaller_app_files = uninstall_old_jalview_files.xml diff --git a/j11lib/getdown-core.jar b/j11lib/getdown-core.jar index c145270..5d149ac 100644 Binary files a/j11lib/getdown-core.jar and b/j11lib/getdown-core.jar differ diff --git a/j8lib/getdown-core.jar b/j8lib/getdown-core.jar index c145270..5d149ac 100644 Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ diff --git a/src/jalview/util/FileUtils.java b/src/jalview/util/FileUtils.java index 2681de6..ce74673 100644 --- a/src/jalview/util/FileUtils.java +++ b/src/jalview/util/FileUtils.java @@ -390,7 +390,7 @@ public class FileUtils { try { - Files.createDirectory(getCanonicalPath(file)); + Files.createDirectories(getCanonicalPath(file)); return file.exists(); } catch (IOException e) {