Browse Source

Fixed bootstrapper and updates

master
JellySquid 3 years ago
parent
commit
077c1628b8

+ 1
- 1
launcher-bootstrap/src/main/java/com/skcraft/launcher/bootstrap/Downloader.java View File

@@ -61,7 +61,7 @@ public class Downloader implements Runnable, ProgressObservable {
61 61
             }
62 62
         });
63 63
 
64
-        File finalFile = new File(bootstrap.getBinariesDir(), System.currentTimeMillis() + ".jar.pack.gz");
64
+        File finalFile = new File(bootstrap.getBinariesDir(), "release-" + System.currentTimeMillis() + ".jar.pack.gz");
65 65
         File tempFile = new File(finalFile.getParentFile(), finalFile.getName() + ".tmp");
66 66
         URL updateUrl = HttpRequest.url(bootstrap.getProperties().getProperty("latestUrl"));
67 67
 

+ 4
- 2
launcher-bootstrap/src/main/java/com/skcraft/launcher/bootstrap/LauncherBinary.java View File

@@ -31,7 +31,7 @@ public class LauncherBinary implements Comparable<LauncherBinary> {
31 31
     public LauncherBinary(File path) {
32 32
         this.path = path;
33 33
         String name = path.getName();
34
-        Matcher m = PATTERN.matcher(name);
34
+        Matcher m = PATTERN.matcher(name.substring("release-".length()));
35 35
         if (!m.matches()) {
36 36
             throw new IllegalArgumentException("Invalid filename: " + path);
37 37
         }
@@ -106,7 +106,9 @@ public class LauncherBinary implements Comparable<LauncherBinary> {
106 106
     public static class Filter implements FileFilter {
107 107
         @Override
108 108
         public boolean accept(File file) {
109
-            return file.isFile() && LauncherBinary.PATTERN.matcher(file.getName()).matches();
109
+            boolean patched = file.getName().startsWith("release-");
110
+
111
+            return file.isFile() && LauncherBinary.PATTERN.matcher(file.getName().substring("release-".length())).matches() && patched;
110 112
         }
111 113
     }
112 114
 }

+ 1
- 1
launcher/src/main/java/com/skcraft/launcher/selfupdate/SelfUpdater.java View File

@@ -39,7 +39,7 @@ public class SelfUpdater implements Callable<File>, ProgressObservable {
39 39
 
40 40
         try {
41 41
             File dir = launcher.getLauncherBinariesDir();
42
-            File file = new File(dir, String.valueOf(System.currentTimeMillis()) + ".jar.pack.gz");
42
+            File file = new File(dir, "release-" + String.valueOf(System.currentTimeMillis()) + ".jar.pack.gz");
43 43
             File tempFile = installer.getDownloader().download(url, "", 10000, "launcher.jar.pack.gz");
44 44
 
45 45
             progress = installer.getDownloader();

Loading…
Cancel
Save