Fix DefaultLauncher (#2584)

This commit is contained in:
Burning_TNT
2023-12-15 20:38:23 +08:00
committed by GitHub
parent cb7975515a
commit ab41feff42

View File

@@ -26,6 +26,7 @@ import org.jackhuang.hmcl.util.gson.UUIDTypeAdapter;
import org.jackhuang.hmcl.util.io.FileUtils;
import org.jackhuang.hmcl.util.io.IOUtils;
import org.jackhuang.hmcl.util.io.Unzipper;
import org.jackhuang.hmcl.util.platform.Bits;
import org.jackhuang.hmcl.util.platform.*;
import org.jackhuang.hmcl.util.versioning.VersionNumber;
@@ -557,7 +558,7 @@ public class DefaultLauncher extends Launcher {
if (!FileUtils.makeFile(scriptFile))
throw new IOException("Script file: " + scriptFile + " cannot be created.");
OutputStream outputStream = new FileOutputStream(scriptFile);
try (OutputStream outputStream = Files.newOutputStream(scriptFile.toPath())) {
Charset charset = StandardCharsets.UTF_8;
if (isWindows) {
@@ -645,6 +646,7 @@ public class DefaultLauncher extends Launcher {
}
}
}
}
if (!scriptFile.setExecutable(true))
throw new PermissionException();