Check for illegal characters of the HMCL directory path

This commit is contained in:
Glavo 2021-12-24 22:53:32 +08:00 committed by Yuhui Huang
parent cfa1eedae7
commit e65f664821
4 changed files with 7 additions and 0 deletions

View File

@ -70,6 +70,10 @@ public final class Launcher extends Application {
Main.showErrorAndExit(i18n("fatal.config_loading_failure", Paths.get("").toAbsolutePath().normalize()));
}
if (Metadata.HMCL_DIRECTORY.toAbsolutePath().toString().indexOf('=') >= 0) {
Main.showWarningAndContinue(i18n("fatal.illegal_char"));
}
// runLater to ensure ConfigHolder.init() finished initialization
Platform.runLater(() -> {
// When launcher visibility is set to "hide and reopen" without Platform.implicitExit = false,

View File

@ -314,6 +314,7 @@ fatal.config_loading_failure=The configuration is not accessible.\nPlease ensure
fatal.migration_requires_manual_reboot=The update is complete. Please reopen Hello Minecraft! Launcher.
fatal.apply_update_failure=We're sorry, Hello Minecraft! Launcher couldn't finish the update because something went wrong.\nBut you can still manually finish the update by downloading Hello Minecraft! Launcher from %s.\nPlease consider reporting this issue to us.
fatal.samba=If you are trying to run HMCL in a shared folder by Samba, HMCL may not working, please try updating your Java or running HMCL in a local folder.
fatal.illegal_char=Illegal character '=' in your user folder path. HMCL can work, but some features don't work.\nYou will not be able to use the authlib-injector account or changing skin of offline account, and there may be greater security risks in multiplayer games.
feedback=Feedback
feedback.add=Add Feedback

View File

@ -314,6 +314,7 @@ fatal.config_loading_failure=Hello Minecraft! Launcher 無法載入設定檔案
fatal.migration_requires_manual_reboot=Hello Minecraft! Launcher 即將升級完成,請重新開啟 Hello Minecraft! Launcher。
fatal.apply_update_failure=我們很抱歉 Hello Minecraft! Launcher 無法自動完成升級程式,因為出現了一些問題。\n但你依然可以從 %s 處手動下載 Hello Minecraft! Launcher 來完成升級。\n請考慮向我們回報該問題。
fatal.samba=如果您正在通過 Samba 共亯的資料夾中運行 HMCLHMCL 可能無法正常工作,請嘗試更新您的 Java 或在本地資料夾內運行 HMCL。
fatal.illegal_char=您的用戶資料夾路徑中存在非法字元‘=。HMCL 能够運行,但一些功能無法正常使用。 \n您將無法使用外置登入帳戶以及離線登入更換皮膚功能並且在進行多人遊戲時可能存在更大的安全隱患。
feedback=回饋
feedback.add=新增回饋

View File

@ -314,6 +314,7 @@ fatal.config_loading_failure=Hello Minecraft! Launcher 无法加载配置文件
fatal.migration_requires_manual_reboot=Hello Minecraft! Launcher 即将完成升级,请重新打开 Hello Minecraft! Launcher。
fatal.apply_update_failure=我们很抱歉 Hello Minecraft! Launcher 无法自动完成升级,因为出现了一些问题。\n但你依然可以从 %s 处手动下载 Hello Minecraft! Launcher 来完成升级。\n请考虑向我们反馈该问题。
fatal.samba=如果您正在通过 Samba 共享的文件夹中运行 HMCLHMCL 可能无法正常工作,请尝试更新您的 Java 或在本地文件夹内运行 HMCL。
fatal.illegal_char=您的用户文件夹路径中存在非法字符‘=。HMCL 能够运行,但一些功能无法正常使用。\n您将无法使用外置登陆账户以及离线登陆更换皮肤功能并且在进行多人游戏时可能存在更大的安全隐患。
feedback=反馈
feedback.add=新增反馈