From: Ben Soares Date: Wed, 19 Jun 2019 00:29:05 +0000 (+0100) Subject: JAL-3321 Corrected the badly configured getdown-launcher.jar for updating and updated... X-Git-Tag: Release_2_11_0~6^2^2~2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b36478ce646df46b638fc673ab6434f01711c04b;p=jalview.git JAL-3321 Corrected the badly configured getdown-launcher.jar for updating and updated build.gradle to make the right getdown.txt file --- diff --git a/build.gradle b/build.gradle index 71eb491..af9a26f 100644 --- a/build.gradle +++ b/build.gradle @@ -807,7 +807,7 @@ task getdownWebsite() { // getdown-launcher.jar should not be in main application class path so the main application can move it when updated. Listed as a resource so it gets updated. //getdownTextString += "class = " + file(getdownLauncher).getName() + "\n" - getdownTextString += "resource = " + file(getdownLauncher).getName() + "\n" + getdownTextString += "resource = " + getdown_launcher_new + "\n" getdownTextString += "class = " + mainClass + "\n" def getdown_txt = file(project.ext.getdownWebsiteDir + "/getdown.txt") @@ -819,6 +819,13 @@ task getdownWebsite() { } copy { + from project.ext.getdownWebsiteDir + into project.ext.getdownWebsiteDir + include(file(getdownLauncher).getName()) + rename(file(getdownLauncher).getName(), getdown_launcher_new) + } + + copy { from getdownLauncher into project.ext.getdownFilesDir } diff --git a/getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar b/getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar index bbeb351..8828380 100644 Binary files a/getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar and b/getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar differ diff --git a/getdown/lib/getdown-launcher.jar b/getdown/lib/getdown-launcher.jar index 6323dc9..1efee70 100644 Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ diff --git a/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java b/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java index 5750fce..d82ed15 100644 --- a/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java +++ b/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java @@ -499,6 +499,19 @@ public abstract class Getdown extends Thread throw new IOException("m.java_download_failed"); } + // on Windows, if the local JVM is in use, we will not be able to replace it with an + // updated JVM; we detect this by attempting to rename the java.dll to its same name, which + // will fail on Windows for in use files; hackery! + File javaLocalDir = new File(_app.getAppDir(), LaunchUtil.LOCAL_JAVA_DIR+File.separator); + File javaDll = new File(javaLocalDir, "bin" + File.separator + "java.dll"); + if (javaDll.exists()) { + if (!javaDll.renameTo(javaDll)) { + log.info("Cannot update local Java VM as it is in use."); + return; + } + log.info("Can update local Java VM as it is not in use."); + } + reportTrackingEvent("jvm_start", -1); updateStatus("m.downloading_java"); diff --git a/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java b/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java index 2d19089..eaf9f2e 100644 --- a/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java +++ b/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java @@ -92,6 +92,7 @@ public class GetdownApp } if (abort) System.exit(-1); + log.info("Starting...."); try { jalview.bin.StartupNotificationListener.setListener(); diff --git a/gradle.properties b/gradle.properties index 08bcbd7..9ec5511 100644 --- a/gradle.properties +++ b/gradle.properties @@ -51,6 +51,7 @@ getdown_app_dir = dist #getdown_j11lib_dir = j11lib getdown_files_dir = getdown/files getdown_launcher = getdown/lib/getdown-launcher.jar +getdown_launcher_new = getdown-launcher-new.jar getdown_core = getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar getdown_base_txt = getdown/files/getdown.txt getdown_txt_title = Jalview @@ -77,7 +78,7 @@ getdown_txt_ui.install_error = http://www.jalview.org/download/error getdown_txt_ui.mac_dock_icon = resources/images/jalview_logos.ico getdown_alt_java8_min_version = 01080000 getdown_alt_java11_min_version = 11000000 -getdown_alt_java11_txt_multi_java_location = [windows-amd64] /getdown/jre/windows-jre11.tgz,[linux-amd64] /getdown/jre/linux-jre11.tgz,[mac os x] /getdown/jre/macos-jre11.tgz +getdown_alt_java11_txt_multi_java_location = [windows-amd64] /getdown/jre/windows-jre11.jar,[linux-amd64] /getdown/jre/linux-jre11.tgz,[mac os x] /getdown/jre/macos-jre11.tgz getdown_alt_java8_txt_multi_java_location = [windows-amd64] /getdown/jre/windows-jre1.8.tgz,[linux-amd64] /getdown/jre/linux-jre1.8.tgz,[mac os x] /getdown/jre/macos-jre1.8.tgz JRE_installs = /Users/bsoares/Java/installs Windows_JRE8 = OpenJDK8U-jdk_x64_windows_hotspot_8u202b08/jdk8u202-b08 diff --git a/j11lib/getdown-core.jar b/j11lib/getdown-core.jar index bbeb351..8828380 100644 Binary files a/j11lib/getdown-core.jar and b/j11lib/getdown-core.jar differ diff --git a/j8lib/getdown-core.jar b/j8lib/getdown-core.jar index bbeb351..8828380 100644 Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ