diff --git a/src/main/java/com/threerings/getdown/data/Resource.java b/src/main/java/com/threerings/getdown/data/Resource.java index df18c52..e235d41 100644 --- a/src/main/java/com/threerings/getdown/data/Resource.java +++ b/src/main/java/com/threerings/getdown/data/Resource.java @@ -246,6 +246,17 @@ public class Resource } } + /** + * Installs the {@code getLocalNew} version of this resource to {@code getLocal}. + */ + public void install () throws IOException { + File source = getLocalNew(), dest = getLocal(); + log.info("- " + source); + if (!FileUtil.renameTo(source, dest)) { + throw new IOException("Failed to rename " + source + " to " + dest); + } + } + /** * Unpacks this resource file into the directory that contains it. Returns * false if an error occurs while unpacking it. diff --git a/src/main/java/com/threerings/getdown/launcher/Getdown.java b/src/main/java/com/threerings/getdown/launcher/Getdown.java index 1cd00bb..7a6384e 100644 --- a/src/main/java/com/threerings/getdown/launcher/Getdown.java +++ b/src/main/java/com/threerings/getdown/launcher/Getdown.java @@ -144,11 +144,7 @@ public abstract class Getdown extends Thread if (_readyToInstall) { log.info("Installing downloaded resources:"); for (Resource resource : _toBeInstalledResouces) { - File source = resource.getLocalNew(), dest = resource.getLocal(); - log.info("- " + source); - if (!FileUtil.renameTo(source, dest)) { - throw new IOException("Failed to rename " + source + " to " + dest); - } + resource.install(); if (Thread.interrupted()) { throw new InterruptedException("m.applet_stopped"); } @@ -642,6 +638,7 @@ public abstract class Getdown extends Thread reportTrackingEvent("jvm_unpack", -1); updateStatus("m.unpacking_java"); + vmjar.install(); if (!vmjar.unpack()) { throw new IOException("m.java_unpack_failed"); }