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 {
}
});

File finalFile = new File(bootstrap.getBinariesDir(), System.currentTimeMillis() + ".jar.pack.gz");
File finalFile = new File(bootstrap.getBinariesDir(), "release-" + System.currentTimeMillis() + ".jar.pack.gz");
File tempFile = new File(finalFile.getParentFile(), finalFile.getName() + ".tmp");
URL updateUrl = HttpRequest.url(bootstrap.getProperties().getProperty("latestUrl"));


+ 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> {
public LauncherBinary(File path) {
this.path = path;
String name = path.getName();
Matcher m = PATTERN.matcher(name);
Matcher m = PATTERN.matcher(name.substring("release-".length()));
if (!m.matches()) {
throw new IllegalArgumentException("Invalid filename: " + path);
}
@@ -106,7 +106,9 @@ public class LauncherBinary implements Comparable<LauncherBinary> {
public static class Filter implements FileFilter {
@Override
public boolean accept(File file) {
return file.isFile() && LauncherBinary.PATTERN.matcher(file.getName()).matches();
boolean patched = file.getName().startsWith("release-");

return file.isFile() && LauncherBinary.PATTERN.matcher(file.getName().substring("release-".length())).matches() && patched;
}
}
}

+ 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 {

try {
File dir = launcher.getLauncherBinariesDir();
File file = new File(dir, String.valueOf(System.currentTimeMillis()) + ".jar.pack.gz");
File file = new File(dir, "release-" + String.valueOf(System.currentTimeMillis()) + ".jar.pack.gz");
File tempFile = installer.getDownloader().download(url, "", 10000, "launcher.jar.pack.gz");

progress = installer.getDownloader();

Loading…
Cancel
Save