mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-29 16:50:10 +02:00
Merge pull request #1409 from rtsketo/issue1351
Fixes: #1351 Fixed updater
This commit is contained in:
@@ -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