@@ -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")); | |||
@@ -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; | |||
} | |||
} | |||
} |
@@ -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(); |