Skip to content

Commit

Permalink
Fixed self path location on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmuscaria committed Feb 13, 2024
1 parent baf7f71 commit 76d31a1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/com/juanmuscaria/dmm/util/DuskersHelper.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.juanmuscaria.dmm.util;

import com.juanmuscaria.dmm.ModManagerApplication;
import lombok.SneakyThrows;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.SystemUtils;
import org.slf4j.Logger;
Expand All @@ -11,6 +12,7 @@
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
Expand Down Expand Up @@ -198,8 +200,9 @@ private static void writeWinConfig(boolean modded) throws DialogHelper.ReportedE
}


@SneakyThrows
public static Path getSelfPath() {
return Path.of(ModManagerApplication.class.getProtectionDomain()
.getCodeSource().getLocation().getPath()).toAbsolutePath();
return Paths.get(ModManagerApplication.class.getProtectionDomain()
.getCodeSource().getLocation().toURI()).toAbsolutePath();
}
}

0 comments on commit 76d31a1

Please sign in to comment.