diff options
-rw-r--r-- | Installer/CHANGES.txt | 8 | ||||
-rw-r--r-- | Installer/GL4JInst.java | 2 | ||||
-rw-r--r-- | Installer/MachineCtrl.java | 93 | ||||
-rw-r--r-- | Installer/java.policy | 15 |
4 files changed, 98 insertions, 20 deletions
diff --git a/Installer/CHANGES.txt b/Installer/CHANGES.txt index 39032d2..bc990b3 100644 --- a/Installer/CHANGES.txt +++ b/Installer/CHANGES.txt @@ -12,13 +12,19 @@ This CHANGES starts with version 2.00 ! GL4Java Installer 2.00 is based upon version 1.05, by Ron Cemer ! -Last Changes: 18. November 2000 (Version 2.05) +Last Changes: 21. November 2000 (Version 2.05b) ----------------- TOP = new DOWN = old ----------------- +November 21, 2000 (Version 2.05b): + + - Added J2RE (Java2 JRE) and Java 1.1 classpath support ! + Now the installer will find and - if needed - generates the + lib/ext directory relative to the java.home path ! + November 18, 2000 (Version 2.05): - Added needed privileges to the directory checking methods diff --git a/Installer/GL4JInst.java b/Installer/GL4JInst.java index 18cfa1e..6978050 100644 --- a/Installer/GL4JInst.java +++ b/Installer/GL4JInst.java @@ -24,7 +24,7 @@ public class GL4JInst static private final String gl4javaWWW =
"http://www.jausoft.com/Files/Java/1.1.X/GL4Java/Installer";
- static private final String version = "2.05";
+ static private final String version = "2.05b";
static private final String cannot_install_title =
"Cannot install GL4Java";
diff --git a/Installer/MachineCtrl.java b/Installer/MachineCtrl.java index b6a0c09..c6745ef 100644 --- a/Installer/MachineCtrl.java +++ b/Installer/MachineCtrl.java @@ -13,6 +13,8 @@ public class MachineCtrl implements ActionListener, ItemListener { + public static boolean DEBUG = true; + public String title = null; Frame dialog = null; public Button goToJausoftGL4Java = null; @@ -36,6 +38,9 @@ public class MachineCtrl // Java VM vendor and operating system stuff: public String jvmVendor = null; public String jvmVersion = null; + public int jvmVersionMajor = 1; // min. defaults + public int jvmVersionMinor = 1; // min. defaults + public String jvmHome = null; public boolean isNetscapeJvm = false; public boolean isSunJvm = false; public boolean isMacJvm = false; @@ -80,8 +85,34 @@ public class MachineCtrl // Query Java VM vendor and operating system. jvmVendor = java.lang.System.getProperty("java.vendor").toLowerCase(); + jvmHome = java.lang.System.getProperty("java.home"); jvmVersion = java.lang.System.getProperty("java.version").toLowerCase(); + int i0 = 0; + int i1 = jvmVersion.indexOf(".", i0); + String strhlp = null; + if(i1>0) + { + strhlp = jvmVersion.substring(i0,i1); + try { + jvmVersionMajor = Integer.valueOf(strhlp).intValue(); + } catch (Exception e) + {System.out.println("Not a number: "+strhlp+" ("+jvmVersion+")");} + } + i0 = i1+1; + i1 = jvmVersion.indexOf(".", i0); + if( i1 < 0 ) + i1 = jvmVersion.length(); // no 2nd dot, no bug version number + + if( 0<i0 && i0<i1 ) + { + strhlp = jvmVersion.substring(i0,i1); + try { + jvmVersionMinor = Integer.valueOf(strhlp).intValue(); + } catch (Exception e) + {System.out.println("Not a number: "+strhlp+" ("+jvmVersion+")");} + } + osName = System.getProperty("os.name").toLowerCase(); osVersion = System.getProperty("os.version").toLowerCase(); osArch = System.getProperty("os.arch").toLowerCase(); @@ -128,7 +159,10 @@ public class MachineCtrl System.out.println("\tosArch: "+osArch); System.out.println(""); System.out.println("jvmVendor: "+jvmVendor); - System.out.println("jvmVersion: "+jvmVersion); + System.out.println("jvmVersion: "+jvmVersion+ + "( major "+jvmVersionMajor+ + ", minor "+jvmVersionMinor+")"); + System.out.println("jvmHome: "+jvmHome); System.out.println(""); System.out.println("pathsep: "+pathsep); System.out.println("filesep: "+filesep); @@ -575,52 +609,81 @@ public class MachineCtrl } if ( (isWin32) || (isUnix) || (isMacOs) ) { + if(DEBUG) + System.out.println("find classpath ..."); + String classpath = System.getProperty("java.class.path").replace('\\','/'); - String javahome = System.getProperty("java.home"); - if(javahome!=null) + if(jvmHome!=null && + ( jvmVersionMajor>=2 || + ( jvmVersionMajor==1 && jvmVersionMinor>=2 ) + ) + ) { - javahome=javahome.replace('\\','/'); - if(javahome.toLowerCase().endsWith("/jre")) - classpath+=pathsep+javahome+"/lib/ext/gl4java.jar"; + jvmHome=jvmHome.replace('\\','/'); + classpath=jvmHome+"/lib/ext/gl4java.jar"+ + pathsep+classpath; + + if(DEBUG) + System.out.println("> added java2 lib/ext classpath ..."); } if (classpath != null) { while ( (classpath != null) && (classpath.length() > 0) ) { int p = classpath.indexOf(pathsep); + String thisfile = null; String thispath = null; if (p < 0) { - thispath = classpath; + thisfile = classpath; classpath = null; } else { - thispath = classpath.substring(0,p); + thisfile = classpath.substring(0,p); if ((p+1) < classpath.length()) classpath = classpath.substring(p+1,classpath.length()); else classpath = null; } - if ( (thispath != null) - && (thispath.length() > 0) - && thispath.toLowerCase().endsWith(".jar") + + if(DEBUG) + System.out.println(">> checking thisfile: "+thisfile); + + if ( (thisfile != null) + && (thisfile.length() > 0) + && + ( thisfile.toLowerCase().endsWith(".jar") || + thisfile.toLowerCase().endsWith(".zip") + ) ) { + if(DEBUG) + System.out.println(">> thisfile contains jar/zip archiv - good"); int lastpos = -1, newpos; while ( (newpos = - thispath.indexOf('/',lastpos+1)) + thisfile.indexOf('/',lastpos+1)) >= 0 ) lastpos = newpos; if (lastpos >= 0) { - thispath = thispath.substring(0,lastpos); - if (thispath.toLowerCase().endsWith("/java/classes") - || thispath.toLowerCase().endsWith("/jre/lib/ext") ) + thispath = thisfile.substring(0,lastpos); + if(DEBUG) + System.out.println(">> thispath: "+thispath+" (dirname will be checked)"); + if ( + thispath.toLowerCase().endsWith("/java/classes") + || thispath.toLowerCase().endsWith("/lib/ext") + || thisfile.toLowerCase().endsWith("/lib/classes.zip") + ) { + if(DEBUG) + System.out.println(">> thispath has expected dir names - good"); browser_classes = new String(thispath); + + FileTool.MkdirWithParents(this, thisfile); + if (isUnix) { switch (unixFlavor) diff --git a/Installer/java.policy b/Installer/java.policy index 0ac0cf6..d3482cb 100644 --- a/Installer/java.policy +++ b/Installer/java.policy @@ -1,7 +1,7 @@ // // GL4Java extensions get all permissions ! // -// This peace should be added on top of the file: +// This config-piece should be added on top of the file: // // If a Java2 SDK is used: // <java2-installation>/jre/lib/security/java.policy @@ -9,12 +9,11 @@ // If a Java2 JRE is used: // <jre-installation>/lib/security/java.policy // -// GL4Java Homepage: +// The GL4Java Homepage: // // http://www.jausoft.com/gl4java/ // - grant codeBase "http://www.jausoft.com/Files/Java/1.1.X/GL4Java/Installer/*" { permission java.security.AllPermission; @@ -50,6 +49,16 @@ grant codeBase "http://www.jausoft.com/Files/Java/1.1.X/GL4Java/demos/HodglimsNe permission java.security.AllPermission; }; +grant codeBase "http://www.jausoft.com/Files/Java/1.1.X/GL4Java-Stuff/*" +{ + permission java.security.AllPermission; +}; + +grant codeBase "http://www.jausoft.com/Files/Java/1.1.X/GL4Java-Stuff/psi/*" +{ + permission java.security.AllPermission; +}; + grant codeBase "http://jausoft.goethel.de/Files/Java/1.1.X/GL4Java/Installer/*" { permission java.security.AllPermission; |