Skip to content

Commit

Permalink
Fix autoupdater upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
stirante committed Oct 31, 2019
1 parent 634e5bc commit c3f65f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/stirante/RuneChanger/util/AutoUpdater.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class AutoUpdater {
public static final String UPDATE_JAR_FILENAME = "RuneChangerUpdate.jar";
public static final String UPDATE_ZIP_FILENAME = "update.zip";
public static final String MAIN_JAR_FILENAME = "RuneChanger.jar";
public static final String UPDATE_SCRIPT_FILENAME = "update.bat";
public static final String UPDATE_SCRIPT_FILENAME = "upgrade.bat";
private static Release cachedRelease;

/**
Expand Down Expand Up @@ -158,9 +158,10 @@ private static void downloadUpdate(String fileUrl) {
System.exit(0);
}
else {
extract(new File(UPDATE_ZIP_FILENAME), currentFile.getParentFile());
Files.write(Paths.get(currentFile.getParentFile()
.getAbsolutePath(), UPDATE_SCRIPT_FILENAME),
String.format("@echo off\r\necho %s\r\ntimeout 3\r\ndel \"%s\"\r\nren \"%s\" \"%s\"\r\ncall start.bat\r\nexit\r\n",
String.format("@echo off\r\necho %s\r\ntimeout 3\r\ndel \"%s\"\r\nren \"%s\" \"%s\"\r\ncall open.bat\r\nexit\r\n",
LangHelper.getLang().getString("restart_in_3_seconds"),
currentFile.getAbsolutePath(),
UPDATE_JAR_FILENAME,
Expand Down

0 comments on commit c3f65f5

Please sign in to comment.