Skip to content

Commit 05d9c53

Browse files
committed
Extract server jars when running --dist
1 parent 47c9509 commit 05d9c53

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

loader/src/main/java/com/fox2code/foxloader/installer/InstallerGUI.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,20 @@ public void extractMMCInstance(String baseFileName) {
344344
}
345345

346346
public void extractServer() {
347+
String fileName = Main.currentInstallerFile.getName();
348+
if (fileName.endsWith("-installer.jar")) {
349+
fileName = fileName.replace("-installer.jar", ".jar");
350+
}
351+
this.extractServer(fileName);
352+
}
353+
354+
public void extractServer(String baseFileName) {
347355
if (this.checkInstaller(true)) {
348356
return;
349357
}
350358

351-
String fileName = Main.currentInstallerFile.getName();
352359
File serverDest = new File(Main.currentInstallerFile.getParentFile(),
353-
fileName.substring(0, fileName.length() - 4) + "-server.jar");
360+
baseFileName.substring(0, baseFileName.length() - 4) + "-server.jar");
354361
try (ZipInputStream zipInputStream = new ZipInputStream(
355362
Files.newInputStream(Main.currentInstallerFile.toPath()));
356363
ZipOutputStream zipOutputStream = new ZipOutputStream(

loader/src/main/java/com/fox2code/foxloader/installer/Main.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ public static void main(String[] args) throws Throwable {
8989
Files.copy(currentInstallerFile.toPath(), newName.toPath());
9090
}
9191
installerGUI.extractMMCInstance("fox" + installerName);
92+
installerGUI.extractServer("fox" + installerName);
9293
} else {
9394
installerGUI.extractMMCInstance();
95+
installerGUI.extractServer();
9496
}
9597
return;
9698
}

0 commit comments

Comments
 (0)