Version changes
[jalview.git] / src / jalview / bin / Cache.java
index 8e5e240..e2477d9 100755 (executable)
@@ -52,7 +52,6 @@ public class Cache
     public static void loadProperties(String propsFile)\r
     {\r
         applicationProperties = new Properties();\r
-\r
         propertiesFile = propsFile;\r
         if (propsFile == null)\r
         {\r
@@ -63,6 +62,8 @@ public class Cache
         {\r
             FileInputStream fis = new FileInputStream(propertiesFile);\r
             applicationProperties.load(fis);\r
+            applicationProperties.remove("LATEST_VERSION");\r
+            applicationProperties.remove("VERSION");\r
             fis.close();\r
         }\r
         catch (Exception ex)\r
@@ -96,16 +97,14 @@ public class Cache
         String jnlpVersion = System.getProperty("jalview.version");\r
         String codeVersion = getProperty("VERSION");\r
 \r
+\r
         if(codeVersion==null)\r
         {\r
           // THIS SHOULD ONLY BE THE CASE WHEN TESTING!!\r
           codeVersion = "Test";\r
           jnlpVersion = "Test";\r
-          setProperty("jalview.version", jnlpVersion);\r
-          setProperty("VERSION", codeVersion);\r
         }\r
 \r
-\r
         // jnlpVersion will be null if we're using InstallAnywhere\r
         if(jnlpVersion==null)\r
         {\r
@@ -120,11 +119,18 @@ public class Cache
 \r
               line = line.substring(line.indexOf("value=")+7);\r
               line = line.substring(0, line.lastIndexOf("\""));\r
-              setProperty("jalview.version", line);\r
+              jnlpVersion = line;\r
+              break;\r
             }\r
           }catch(Exception ex)\r
-          {  setProperty("jalview.version", codeVersion); }\r
+          {  jnlpVersion =  codeVersion; }\r
         }\r
+\r
+        System.out.println("Version: "+codeVersion);\r
+        System.out.println("Latest : "+jnlpVersion);\r
+\r
+        setProperty("LATEST_VERSION", jnlpVersion);\r
+        setProperty("VERSION", codeVersion);\r
     }\r
 \r
     /**\r