mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-24 14:33:17 +02:00
Fixed update batch file to work in directories with spaces.
This commit is contained in:
@@ -23,7 +23,7 @@ import com.rarchives.ripme.utils.Utils;
|
|||||||
public class UpdateUtils {
|
public class UpdateUtils {
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(UpdateUtils.class);
|
private static final Logger logger = Logger.getLogger(UpdateUtils.class);
|
||||||
private static final String DEFAULT_VERSION = "1.7.86";
|
private static final String DEFAULT_VERSION = "1.7.87";
|
||||||
private static final String REPO_NAME = "ripmeapp/ripme";
|
private static final String REPO_NAME = "ripmeapp/ripme";
|
||||||
private static final String updateJsonURL = "https://raw.githubusercontent.com/" + REPO_NAME + "/master/ripme.json";
|
private static final String updateJsonURL = "https://raw.githubusercontent.com/" + REPO_NAME + "/master/ripme.json";
|
||||||
private static String mainFileName;
|
private static String mainFileName;
|
||||||
@@ -264,12 +264,14 @@ public class UpdateUtils {
|
|||||||
// Windows
|
// Windows
|
||||||
final String batchFile = "update_ripme.bat";
|
final String batchFile = "update_ripme.bat";
|
||||||
final String batchPath = new File(batchFile).getAbsolutePath();
|
final String batchPath = new File(batchFile).getAbsolutePath();
|
||||||
String script = "@echo off\r\n" + "timeout 1\r\n" + "copy " + updateFileName + " " + mainFileName + "\r\n"
|
String script = "@echo off\r\n" + "timeout 1\r\n"
|
||||||
+ "del " + updateFileName + "\r\n";
|
+ "copy \"" + updateFileName + "\" \"" + mainFileName + "\"\r\n"
|
||||||
if (shouldLaunch) {
|
+ "del \"" + updateFileName + "\"\r\n";
|
||||||
script += mainFileName + "\r\n";
|
|
||||||
}
|
if (shouldLaunch)
|
||||||
script += "del " + batchPath + "\r\n";
|
script += "\"" + mainFileName + "\"\r\n";
|
||||||
|
script += "del \"" + batchPath + "\"\r\n";
|
||||||
|
|
||||||
final String[] batchExec = new String[] { batchPath };
|
final String[] batchExec = new String[] { batchPath };
|
||||||
// Create updater script
|
// Create updater script
|
||||||
try (BufferedWriter bw = new BufferedWriter(new FileWriter(batchFile))) {
|
try (BufferedWriter bw = new BufferedWriter(new FileWriter(batchFile))) {
|
||||||
|
Reference in New Issue
Block a user