Check writable on jarfile for conifg (#1084)

This commit is contained in:
catsout
2021-10-05 18:12:08 +08:00
committed by GitHub
parent 8748b8c277
commit c3fc22c6a9

View File

@@ -108,7 +108,7 @@ public final class ConfigHolder {
try {
Path jarPath = Paths.get(ConfigHolder.class.getProtectionDomain().getCodeSource().getLocation()
.toURI()).toAbsolutePath();
if (Files.isRegularFile(jarPath)) {
if (Files.isRegularFile(jarPath) && Files.isWritable(jarPath)) {
jarPath = jarPath.getParent();
exePath = jarPath;