Skip to content

Commit

Permalink
Remove packed check from launcher self-updater
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgehog1029 committed Feb 19, 2021
1 parent dd3f4e7 commit daa955f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,22 @@ public class SelfUpdater implements Callable<File>, ProgressObservable {
private final Launcher launcher;
private final URL url;
private final Installer installer;
private final boolean packed;
private ProgressObservable progress = new DefaultProgress(0, SharedLocale.tr("updater.updating"));

public SelfUpdater(@NonNull Launcher launcher, @NonNull URL url, boolean packed) {
public SelfUpdater(@NonNull Launcher launcher, @NonNull URL url) {
this.launcher = launcher;
this.url = url;
this.installer = new Installer(launcher.getInstallerDir());
this.packed = packed;
}

@Override
public File call() throws Exception {
ExecutorService executor = Executors.newSingleThreadExecutor();

try {
String extension = packed ? ".jar.pack" : ".jar";
File dir = launcher.getLauncherBinariesDir();
File file = new File(dir, System.currentTimeMillis() + extension);
File tempFile = installer.getDownloader().download(url, "", 10000, "launcher" + extension);
File file = new File(dir, System.currentTimeMillis() + ".jar");
File tempFile = installer.getDownloader().download(url, "", 10000, "launcher.jar");

progress = installer.getDownloader();
installer.download();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void performUpdate(final Window window) {
final URL url = pendingUpdate.getUrl();

if (url != null) {
SelfUpdater downloader = new SelfUpdater(launcher, url, pendingUpdate.isPacked());
SelfUpdater downloader = new SelfUpdater(launcher, url);
ObservableFuture<File> future = new ObservableFuture<File>(
launcher.getExecutor().submit(downloader), downloader);

Expand Down

0 comments on commit daa955f

Please sign in to comment.