From 458793f0c06eb89c7a52dfafea1c2510692eb61f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=9E=E5=BA=90?= <109708109+CiiLu@users.noreply.github.com> Date: Mon, 17 Nov 2025 16:37:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20Windows=20=E4=B8=8B?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E8=AE=BE=E7=BD=AE=E4=B8=AD=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E5=BA=93=E8=B7=AF=E5=BE=84=E8=B7=AF=E5=BE=84=E5=88=86=E9=9A=94?= =?UTF-8?q?=E7=AC=A6=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#4808)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hmcl/ui/versions/AdvancedVersionSettingPage.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/AdvancedVersionSettingPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/AdvancedVersionSettingPage.java index fdbab21b1..dbb3d6e16 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/AdvancedVersionSettingPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/AdvancedVersionSettingPage.java @@ -11,16 +11,18 @@ import javafx.scene.control.Label; import javafx.scene.control.ScrollPane; import javafx.scene.layout.*; import org.jackhuang.hmcl.game.NativesDirectoryType; -import org.jackhuang.hmcl.setting.Profile; import org.jackhuang.hmcl.game.Renderer; +import org.jackhuang.hmcl.setting.Profile; import org.jackhuang.hmcl.setting.VersionSetting; import org.jackhuang.hmcl.ui.FXUtils; import org.jackhuang.hmcl.ui.construct.*; import org.jackhuang.hmcl.ui.decorator.DecoratorPage; +import org.jackhuang.hmcl.util.io.FileUtils; import org.jackhuang.hmcl.util.platform.OperatingSystem; import org.jackhuang.hmcl.util.platform.Platform; import org.jetbrains.annotations.Nullable; +import java.nio.file.FileSystems; import java.util.Arrays; import java.util.Locale; @@ -250,8 +252,8 @@ public final class AdvancedVersionSettingPage extends StackPane implements Decor if (versionSetting.getNativesDirType() == NativesDirectoryType.VERSION_FOLDER) { String nativesDirName = "natives-" + Platform.SYSTEM_PLATFORM; if (versionId == null) { - return String.format("%s/%s/%s", - profile.getRepository().getBaseDirectory().resolve("versions").toAbsolutePath().normalize(), + return String.join(FileSystems.getDefault().getSeparator(), + FileUtils.getAbsolutePath(profile.getRepository().getBaseDirectory().resolve("versions")), i18n("settings.advanced.natives_directory.default.version_id"), nativesDirName );