aboutsummaryrefslogtreecommitdiffstats
path: root/Installer
diff options
context:
space:
mode:
Diffstat (limited to 'Installer')
-rw-r--r--Installer/.htaccess1
-rw-r--r--Installer/CHANGES.txt82
-rw-r--r--Installer/FileTool.java645
-rw-r--r--Installer/FilelistGL4JArchiv.java.skel11
-rw-r--r--Installer/FilelistGL4JClasses.java.skel11
-rw-r--r--Installer/FilelistGLUTFontArchiv.java.skel11
-rw-r--r--Installer/FilelistGLUTFontClasses.java.skel11
-rw-r--r--Installer/FilelistHPUXPaRisc.java.skel11
-rw-r--r--Installer/FilelistLinuxI386GlibcXF86.java.skel11
-rw-r--r--Installer/FilelistLinuxPPCGlibcXF86.java.skel11
-rw-r--r--Installer/FilelistMacOSPPC.java.skel11
-rw-r--r--Installer/FilelistOS.java6
-rw-r--r--Installer/FilelistPNGArchiv.java11
-rw-r--r--Installer/FilelistPNGClasses.java11
-rw-r--r--Installer/FilelistSGIIrix62Mips.java.skel11
-rw-r--r--Installer/FilelistSUNSolaris26Sparc.java.skel11
-rw-r--r--Installer/FilelistTool.java66
-rw-r--r--Installer/FilelistWin32I386.java.skel11
-rw-r--r--Installer/FilelistWin95I386OpenGL.java11
-rw-r--r--Installer/GL4JInst.html24
-rw-r--r--Installer/GL4JInst.java730
-rw-r--r--Installer/GL4JInst_cacert_ns.html58
-rw-r--r--Installer/GL4JInst_f13plugin.html44
-rw-r--r--Installer/GL4JInst_fie.html13
-rw-r--r--Installer/GL4JInst_fns.html12
-rw-r--r--Installer/GL4JInst_fstd.html12
-rw-r--r--Installer/GL4JInst_ie.html24
-rw-r--r--Installer/GL4JInst_ie_check.html41
-rw-r--r--Installer/GL4JInst_ns.html23
-rw-r--r--Installer/MSJVMVersionApplet.java33
-rw-r--r--Installer/MachineCtrl.java988
-rw-r--r--Installer/README.txt87
-rw-r--r--Installer/index.html33
-rw-r--r--Installer/install.bat12
-rwxr-xr-xInstaller/install.sh9
-rw-r--r--Installer/java.policy51
-rwxr-xr-xInstaller/makeJar-Unix.sh16
-rwxr-xr-xInstaller/makeMSIESignedCab.sh19
-rwxr-xr-xInstaller/makeNetscapeSignedJar-Unix.sh33
-rwxr-xr-xInstaller/makeNetscapeSignedJar-Win32.sh33
-rw-r--r--Installer/versiondef.sh11
-rw-r--r--Installer/versionundef.sh5
42 files changed, 3265 insertions, 0 deletions
diff --git a/Installer/.htaccess b/Installer/.htaccess
new file mode 100644
index 0000000..c509e32
--- /dev/null
+++ b/Installer/.htaccess
@@ -0,0 +1 @@
+AddType application/x-x509-ca-cert CRT
diff --git a/Installer/CHANGES.txt b/Installer/CHANGES.txt
new file mode 100644
index 0000000..d8b68bf
--- /dev/null
+++ b/Installer/CHANGES.txt
@@ -0,0 +1,82 @@
+\begin{verbatim}
+
+ GL4Java Installer
+ Copyright (c) 1999 Ronald B. Cemer
+
+ GL4Java Installer 2.04
+ Copyright (c) 1999 Ronald B. Cemer, Sven Goethel
+
+This is the CHANGES file for the GL4Java Installer !
+
+This CHANGES starts with version 2.00 !
+
+GL4Java Installer 2.00 is based upon version 1.05, by Ron Cemer !
+
+Last Changes: 19. August 2000 (Version 2.04)
+
+-----------------
+TOP = new
+DOWN = old
+-----------------
+
+August 19, 2000 (Version 2.04):
+
+ - Improved the standalone installation.
+ - The Installer has now its own binpkg zip archiv,
+ to be downloaded !
+ - Unix and Dos startscripts are supported !
+ - All needed Files for the installation procedure
+ are fetched from the jausoft website,
+ during the installation, if they does not exist localy !
+
+ - Added machine info printouts ...
+
+June 08, 2000 (Version 2.03):
+
+ - Adding Linux-PowerPC
+ - Respecting GL4Java 2.4.0, only one generic GL vendor exists :)
+ - If no JVM vendor can be fetched, a SUN-JVM compatible one
+ is expected.
+
+April 01, 2000 (Version 2.02):
+
+ - Adding Sun-JVM 1.1.X & Sun-Java2 support for the
+ - appletviewer/hotjava-browser/Java2-PlugIn
+ - application (java -cp GL4JInst.jar GL4JInst)
+
+ - Now it is possible, to bundle the directories:
+ ./Installer
+ ./binpkg
+ together - to run the installer as a standalone application !
+
+Dezember 07, 1999 (Version 2.00 - Sven Goethel):
+
+ Starting integrating the Installer to the GL4Java Homepage !
+
+ This version 2.00 is based upon the original version 1.05,
+ by Ron Cemer !
+
+ - Splitting the class GL4JInst into:
+ GL4JInst
+ MachineCtrl
+ FilelistOS (interface for:)
+ FilelistJavaArchiv
+ FilelistJavaClasses
+ FilelistLinuxI386GlibcMesaNVidia
+ FilelistLinuxI386GlibcMesaSoft
+ FilelistWin32I386
+ FilelistWin95I386OpenGL
+ FilelistTool
+ FileTool
+
+ This is done in the nature to achive the know-how
+ of Ron's code, so I had to do a little clean-up ;-)
+
+ - The Applet-Tag parameter is *not* supported know !
+
+ - The archive files are fetched directly
+ out of the ../binpkg directory.
+ The archive files are created with the makefile
+ of GL4Java
+
+\end{verbatim}
diff --git a/Installer/FileTool.java b/Installer/FileTool.java
new file mode 100644
index 0000000..49cc782
--- /dev/null
+++ b/Installer/FileTool.java
@@ -0,0 +1,645 @@
+import java.awt.*;
+import java.io.*;
+import java.net.*;
+import java.util.*;
+import java.util.zip.*;
+
+public class FileTool
+{
+ public static final boolean fileExists(MachineCtrl mctrl,
+ String filename
+ )
+ {
+ if (mctrl.isNetscapeJvm)
+ {
+ try
+ {
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalFileAccess");
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalConnect");
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalFdRead");
+ }
+ catch (Exception e)
+ {
+ System.out.println
+ ("Netscape denied privileges, or a failure occurred.\n"+
+ "Here is the exception that was caught:\n"+e+"\n");
+ return false;
+ }
+ }
+ else if (mctrl.isMicrosoftJvm)
+ {
+ try
+ {
+ com.ms.security.PolicyEngine.assertPermission (com.ms.security.PermissionID.FILEIO);
+ com.ms.security.PolicyEngine.assertPermission
+ (com.ms.security.PermissionID.PROPERTY);
+ com.ms.security.PolicyEngine.assertPermission
+ (com.ms.security.PermissionID.SYSTEM);
+ }
+ catch (Exception e)
+ {
+ System.out.println
+ ("Microsoft VM denied privileges, or a failure occurred.\n"+
+ "Here is the exception that was caught:\n"+e+"\n");
+ return false;
+ }
+ }
+ File f = new File(filename);
+ return f.exists();
+ }
+
+ public static final boolean libraryExists(MachineCtrl mctrl,
+ String libname, Vector libdirlist
+ )
+ {
+ if (mctrl.isNetscapeJvm)
+ {
+ try
+ {
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalFileAccess");
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalExecAccess");
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalConnect");
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalFdRead");
+ }
+ catch (Exception e)
+ {
+ System.out.println
+ ("Netscape denied privileges, or a failure occurred.\n"+
+ "Here is the exception that was caught:\n"+e+"\n");
+ return false;
+ }
+ }
+ else if (mctrl.isMicrosoftJvm)
+ {
+ try
+ {
+ com.ms.security.PolicyEngine.assertPermission (com.ms.security.PermissionID.FILEIO);
+ com.ms.security.PolicyEngine.assertPermission
+ (com.ms.security.PermissionID.PROPERTY);
+ com.ms.security.PolicyEngine.assertPermission
+ (com.ms.security.PermissionID.SYSTEM);
+ }
+ catch (Exception e)
+ {
+ System.out.println
+ ("Microsoft VM denied privileges, or a failure occurred.\n"+
+ "Here is the exception that was caught:\n"+e+"\n");
+ return false;
+ }
+ }
+ if (mctrl.isUnix)
+ {
+ File f = new File("/etc/ld.so.conf");
+ if (f.exists())
+ {
+ try
+ {
+ BufferedReader br =
+ new BufferedReader(new FileReader(f));
+ try
+ {
+ while (true)
+ {
+ String s = br.readLine();
+ if (s == null) break;
+ if (s.length() > 0)
+ libdirlist.addElement(new String(s));
+ }
+ }
+ catch (Exception e)
+ {
+ br.close();
+ }
+ }
+ catch (Exception e)
+ { }
+ }
+ }
+ if (libdirlist != null)
+ {
+ for (int i = 0; i < libdirlist.size(); i++)
+ {
+ String s = (String)libdirlist.elementAt(i);
+ if ( (s != null) && (s.length() > 0) )
+ {
+ if (new File(s + "/" + libname).exists())
+ {
+ System.out.println
+ ("File found: "+s + "/" + libname+"\n");
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Create all directory entries,
+ * which the given path contains !
+ *
+ * The given path can contain a file at the end,
+ * only elements finishing with a "/" are interpreted as an
+ * directory, therefor only for these, directories are created !
+ *
+ * E.g. "../binpkg/test.zip"
+ * The following directories will be created:
+ * .. -> error is catched and ignored
+ * ../binpkg/
+ *
+ *
+ * This is the same, like "mkdir -P /hello/dirs/" !
+ */
+ public static final boolean MkdirWithParents(MachineCtrl mctrl, String path)
+ {
+ if(path==null) return true;
+
+ if (mctrl.isNetscapeJvm)
+ {
+ try
+ {
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalFileAccess");
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalExecAccess");
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalConnect");
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalFdRead");
+ }
+ catch (Exception e)
+ {
+ System.out.println
+ ("Netscape denied privileges, or a failure occurred.\n"+
+ "Here is the exception that was caught:\n"+e+"\n");
+ return false;
+ }
+ }
+ else if (mctrl.isMicrosoftJvm)
+ {
+ try
+ {
+ com.ms.security.PolicyEngine.assertPermission (com.ms.security.PermissionID.FILEIO);
+ com.ms.security.PolicyEngine.assertPermission
+ (com.ms.security.PermissionID.PROPERTY);
+ com.ms.security.PolicyEngine.assertPermission
+ (com.ms.security.PermissionID.SYSTEM);
+ }
+ catch (Exception e)
+ {
+ System.out.println
+ ("Microsoft VM denied privileges, or a failure occurred.\n"+
+ "Here is the exception that was caught:\n"+e+"\n");
+ return false;
+ }
+ }
+ int dl = path.length();
+ int pos = 0;
+ File tmpdir = null;
+ String thisPath = null;
+
+ while(0<=pos && pos<dl)
+ {
+ pos = path.indexOf('/', pos+1);
+ if(pos>0)
+ {
+ thisPath = path.substring(0,pos);
+ tmpdir = new File (thisPath);
+ try
+ {
+ tmpdir.mkdir();
+ System.out.println("mkdir "+thisPath);
+ }
+ catch (Exception e0)
+ { }
+ tmpdir = null;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Copy all files from the zip
+ * or jar archive pointed to by zipURL to their
+ * corresponding destination given in targetDirs[] !
+ *
+ * The status window is updated with the name of the
+ * source file being copied.
+ *
+ * Each listed source file is simultaneously copied to
+ * all of its destination files. This means that the
+ * zip archive is only read once to minimize the amount
+ * of data that is transferred over the network.
+ */
+ public static final boolean copyFilesFromZip
+ (MachineCtrl mctrl,
+ URL zipURL, String targetDirs[],
+ TextArea statustextarea
+ )
+ {
+ int i, j;
+ boolean ok = true;
+ int nFiles = targetDirs.length;
+ String srcFile = null;
+ String destFiles[] = new String[nFiles];
+ File dstfils[] = new File[nFiles];
+ FileOutputStream fos[] = new FileOutputStream[nFiles];
+
+ if(targetDirs==null) return true;
+
+ if (mctrl.isNetscapeJvm)
+ {
+ try
+ {
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalFileAccess");
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalExecAccess");
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalConnect");
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalFdRead");
+ }
+ catch (Exception e)
+ {
+ System.out.println
+ ("Netscape denied privileges, or a failure occurred.\n"+
+ "Here is the exception that was caught:\n"+e+"\n");
+ return false;
+ }
+ }
+ else if (mctrl.isMicrosoftJvm)
+ {
+ try
+ {
+ com.ms.security.PolicyEngine.assertPermission (com.ms.security.PermissionID.FILEIO);
+ com.ms.security.PolicyEngine.assertPermission
+ (com.ms.security.PermissionID.PROPERTY);
+ com.ms.security.PolicyEngine.assertPermission
+ (com.ms.security.PermissionID.SYSTEM);
+ }
+ catch (Exception e)
+ {
+ System.out.println
+ ("Microsoft VM denied privileges, or a failure occurred.\n"+
+ "Here is the exception that was caught:\n"+e+"\n");
+ return false;
+ }
+ }
+ for (i = 0; i < nFiles; i++)
+ {
+ //
+ // adding a trailing path-seperator, if needed !
+ //
+ if(targetDirs[i]!=null)
+ {
+ targetDirs[i] = targetDirs[i].trim();
+ if(targetDirs[i].indexOf('/', targetDirs[i].length()-1)<0)
+ targetDirs[i] += "/";
+ System.out.println("targetDir: "+targetDirs[i]);
+ }
+ }
+
+ ZipInputStream zis = null;
+
+ // Open the archive.
+ try
+ {
+ zis = new ZipInputStream(zipURL.openStream());
+ }
+ catch (Exception e0)
+ {
+ if(statustextarea!=null)
+ statustextarea.setText
+ (statustextarea.getText() +
+ "Cannot open file: " + zipURL + "\n");
+ return false; // Should never happen!
+ }
+
+ try
+ {
+ while (ok)
+ {
+ ZipEntry entry = zis.getNextEntry();
+ if(entry==null)
+ break;
+
+ if (!entry.isDirectory())
+ {
+ srcFile = entry.getName();
+
+ for(i=0; ok && i<nFiles; i++)
+ {
+ destFiles[i] = targetDirs[i] + srcFile;
+ dstfils[i] = new File(destFiles[i]);
+
+ if (dstfils[i].exists())
+ {
+ try
+ {
+ dstfils[i].delete();
+ }
+ catch (Exception e0)
+ { }
+ } else {
+ FileTool.MkdirWithParents(mctrl, destFiles[i]);
+ }
+
+ try
+ {
+ fos[i] = new FileOutputStream(dstfils[i]);
+ }
+ catch (Exception e0)
+ {
+ fos[i] = null;
+
+ if(statustextarea!=null)
+ statustextarea.setText
+ (statustextarea.getText() +
+ "Cannot create file: " + destFiles[i] + "\n");
+ ok= false;
+ break; // breaks the beast ...
+ }
+ }
+
+ if(ok)
+ if(statustextarea!=null)
+ statustextarea.setText
+ (statustextarea.getText() +
+ "Installing source file: " + srcFile );
+
+ try
+ {
+ byte[] buf = new byte[4096];
+ int bytesread;
+ while (ok &&
+ (bytesread = zis.read(buf,0,buf.length)) >= 0
+ )
+ {
+ if (bytesread < 1) continue;
+ try
+ {
+ // Write the data to the destination files.
+ for (i = 0; ok && i < nFiles; i++)
+ {
+ if (fos[i] != null)
+ fos[i].write(buf,0,bytesread);
+ }
+ if(statustextarea!=null)
+ statustextarea.setText
+ (statustextarea.getText() + ".");
+ }
+ catch (Exception e0)
+ {
+ // We got a write error.
+
+ if(statustextarea!=null)
+ statustextarea.setText
+ (statustextarea.getText() +
+ "\nCannot write file: " + destFiles[i] +
+ "\n");
+
+ ok = false;
+ continue; // breaks the beast ...
+ }
+ }
+ }
+ catch (Exception e0)
+ { } // Should never happen!
+
+ if(statustextarea!=null)
+ statustextarea.setText
+ (statustextarea.getText() + "\n");
+
+ for (j = 0; j < i; j++)
+ {
+ if (fos[j] != null)
+ {
+ try
+ {
+ fos[j].close();
+ }
+ catch(Exception e1)
+ { }
+ }
+ if (!ok && dstfils[j] != null)
+ {
+ try
+ {
+ dstfils[j].delete();
+ }
+ catch (Exception e1)
+ { }
+ fos[j] = null;
+ }
+ }
+ }
+ }
+ }
+ catch (Exception e0)
+ { } // End of archive.
+
+ try
+ {
+ zis.close();
+ }
+ catch(Exception e1)
+ { }
+
+ if(!ok)
+ {
+ if(statustextarea!=null)
+ statustextarea.setText
+ (statustextarea.getText() +
+ "INSTALLATION INCOMPLETE !!\n"+
+ "Please check this log files for reasons !\n");
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Copy srcFile from the remote directory pointed to by
+ * baseURL to the local path pointed to by destFile.
+ *
+ * If baseURL is null,
+ * an ordinary filecopy is used (Local Harddisk)
+ */
+ public static final boolean copyFileFromDir(MachineCtrl mctrl,
+ URL baseURL,
+ String srcFile, String destFile,
+ TextArea statustextarea)
+ {
+ URL srcURL = null;
+ InputStream is = null;
+ FileOutputStream fos = null;
+ File srcfil = null;
+ File dstfil = null;
+ boolean ok = true;
+
+ if (mctrl.isNetscapeJvm)
+ {
+ try
+ {
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalFileAccess");
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalExecAccess");
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalConnect");
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalFdRead");
+ }
+ catch (Exception e)
+ {
+ System.out.println
+ ("Netscape denied privileges, or a failure occurred.\n"+
+ "Here is the exception that was caught:\n"+e+"\n");
+ return false;
+ }
+ }
+ else if (mctrl.isMicrosoftJvm)
+ {
+ try
+ {
+ com.ms.security.PolicyEngine.assertPermission (com.ms.security.PermissionID.FILEIO);
+ com.ms.security.PolicyEngine.assertPermission
+ (com.ms.security.PermissionID.PROPERTY);
+ com.ms.security.PolicyEngine.assertPermission
+ (com.ms.security.PermissionID.SYSTEM);
+ }
+ catch (Exception e)
+ {
+ System.out.println
+ ("Microsoft VM denied privileges, or a failure occurred.\n"+
+ "Here is the exception that was caught:\n"+e+"\n");
+ return false;
+ }
+ }
+ try
+ {
+ if(baseURL!=null)
+ srcURL = new URL(baseURL.toString() + "/" + srcFile);
+ }
+ catch (Exception e)
+ {
+ if(statustextarea!=null)
+ statustextarea.setText
+ (statustextarea.getText() +
+ "Cannot get URL: " + baseURL.toString()+"/"+srcFile+"\n");
+ return false;
+ }
+
+ dstfil = new File(destFile);
+
+ // Open the source file.
+ try
+ {
+ if(srcURL!=null)
+ is = srcURL.openStream();
+ else {
+ srcfil = new File(srcFile);
+ is = new FileInputStream(srcfil);
+ }
+ }
+ catch (Exception e0)
+ {
+ if(statustextarea!=null)
+ statustextarea.setText
+ (statustextarea.getText() +
+ "Cannot open file: " + srcURL + "\n");
+ return false;
+ }
+
+ FileTool.MkdirWithParents(mctrl, destFile);
+
+ // If the destination file exists, attempt to
+ // delete it.
+ if (dstfil.exists())
+ {
+ try
+ {
+ dstfil.delete();
+ }
+ catch (Exception e0)
+ { }
+ }
+
+ // Create the destination file.
+ try
+ {
+ fos = new FileOutputStream(dstfil);
+ }
+ catch (Exception e0)
+ {
+ if(statustextarea!=null)
+ statustextarea.setText
+ (statustextarea.getText() +
+ "Cannot create file: " + destFile + "\n");
+ ok=false;
+ }
+
+ // Copy the data from the source to the destination.
+ try
+ {
+ byte[] buf = new byte[4096];
+ int bytesread;
+ while (ok && (bytesread = is.read(buf,0,buf.length)) >= 0)
+ {
+ if (bytesread < 1) continue;
+ try
+ {
+ // Write the data to the destination file.
+ fos.write(buf,0,bytesread);
+ }
+ catch (Exception e0)
+ {
+ // Write error.
+ if(statustextarea!=null)
+ statustextarea.setText
+ (statustextarea.getText() +
+ "Cannot write file: " + destFile + "\n");
+ ok = false;
+ }
+ }
+ }
+ catch (Exception e0)
+ { } // Should never happen!
+
+ try
+ {
+ if(is!=null)
+ is.close();
+ }
+ catch(Exception e1)
+ { }
+
+ try
+ {
+ if(fos!=null)
+ fos.close();
+ }
+ catch(Exception e1)
+ { }
+ try
+ {
+ if(!ok && dstfil!=null)
+ dstfil.delete();
+ }
+ catch(Exception e1)
+ { }
+
+ return ok;
+ }
+
+
+}
diff --git a/Installer/FilelistGL4JArchiv.java.skel b/Installer/FilelistGL4JArchiv.java.skel
new file mode 100644
index 0000000..6e31bfe
--- /dev/null
+++ b/Installer/FilelistGL4JArchiv.java.skel
@@ -0,0 +1,11 @@
+
+public class FilelistGL4JArchiv
+ implements FilelistOS
+{
+ public static final String version = "_MAJV_._MINV_._BUGV_._RELV_";
+
+ public static final String archiv = "../binpkg/gl4java_MAJV_._MINV_._BUGV_._RELV_-jar.zip" ;
+
+ public String getVersion() { return version; }
+ public String getArchiv() { return archiv; }
+}
diff --git a/Installer/FilelistGL4JClasses.java.skel b/Installer/FilelistGL4JClasses.java.skel
new file mode 100644
index 0000000..f86ac8a
--- /dev/null
+++ b/Installer/FilelistGL4JClasses.java.skel
@@ -0,0 +1,11 @@
+
+public class FilelistGL4JClasses
+ implements FilelistOS
+{
+ public static final String version = "_MAJV_._MINV_._BUGV_._RELV_";
+
+ public static final String archiv = "../binpkg/gl4java_MAJV_._MINV_._BUGV_._RELV_-classes.zip" ;
+
+ public String getVersion() { return version; }
+ public String getArchiv() { return archiv; }
+}
diff --git a/Installer/FilelistGLUTFontArchiv.java.skel b/Installer/FilelistGLUTFontArchiv.java.skel
new file mode 100644
index 0000000..c364758
--- /dev/null
+++ b/Installer/FilelistGLUTFontArchiv.java.skel
@@ -0,0 +1,11 @@
+
+public class FilelistGLUTFontArchiv
+ implements FilelistOS
+{
+ public static final String version = "_MAJV_._MINV_._BUGV_._RELV_";
+
+ public static final String archiv = "../binpkg/gl4java_MAJV_._MINV_._BUGV_._RELV_-glutfonts-jar.zip" ;
+
+ public String getVersion() { return version; }
+ public String getArchiv() { return archiv; }
+}
diff --git a/Installer/FilelistGLUTFontClasses.java.skel b/Installer/FilelistGLUTFontClasses.java.skel
new file mode 100644
index 0000000..82c1b4a
--- /dev/null
+++ b/Installer/FilelistGLUTFontClasses.java.skel
@@ -0,0 +1,11 @@
+
+public class FilelistGLUTFontClasses
+ implements FilelistOS
+{
+ public static final String version = "_MAJV_._MINV_._BUGV_._RELV_";
+
+ public static final String archiv = "../binpkg/gl4java_MAJV_._MINV_._BUGV_._RELV_-glutfonts-classes.zip" ;
+
+ public String getVersion() { return version; }
+ public String getArchiv() { return archiv; }
+}
diff --git a/Installer/FilelistHPUXPaRisc.java.skel b/Installer/FilelistHPUXPaRisc.java.skel
new file mode 100644
index 0000000..43f9b97
--- /dev/null
+++ b/Installer/FilelistHPUXPaRisc.java.skel
@@ -0,0 +1,11 @@
+
+public class FilelistHPUXPaRisc
+ implements FilelistOS
+{
+ public static final String version = "_MAJV_._MINV_._BUGV_._RELV_";
+
+ public static final String archiv = "../binpkg/libGL4Java_MAJV_._MINV_._BUGV_._RELV_-HPUX-b11-pa_risc.zip";
+
+ public String getVersion() { return version; }
+ public String getArchiv() { return archiv; }
+}
diff --git a/Installer/FilelistLinuxI386GlibcXF86.java.skel b/Installer/FilelistLinuxI386GlibcXF86.java.skel
new file mode 100644
index 0000000..fff686c
--- /dev/null
+++ b/Installer/FilelistLinuxI386GlibcXF86.java.skel
@@ -0,0 +1,11 @@
+
+public class FilelistLinuxI386GlibcXF86
+ implements FilelistOS
+{
+ public static final String version = "_MAJV_._MINV_._BUGV_._RELV_";
+
+ public static final String archiv = "../binpkg/libGL4Java_MAJV_._MINV_._BUGV_._RELV_-Linux-glibc2-xf86-x86.zip";
+
+ public String getVersion() { return version; }
+ public String getArchiv() { return archiv; }
+}
diff --git a/Installer/FilelistLinuxPPCGlibcXF86.java.skel b/Installer/FilelistLinuxPPCGlibcXF86.java.skel
new file mode 100644
index 0000000..1c655b5
--- /dev/null
+++ b/Installer/FilelistLinuxPPCGlibcXF86.java.skel
@@ -0,0 +1,11 @@
+
+public class FilelistLinuxPPCGlibcXF86
+ implements FilelistOS
+{
+ public static final String version = "_MAJV_._MINV_._BUGV_._RELV_";
+
+ public static final String archiv = "../binpkg/libGL4Java_MAJV_._MINV_._BUGV_._RELV_-Linux-glibc2-xf86-ppc.zip";
+
+ public String getVersion() { return version; }
+ public String getArchiv() { return archiv; }
+}
diff --git a/Installer/FilelistMacOSPPC.java.skel b/Installer/FilelistMacOSPPC.java.skel
new file mode 100644
index 0000000..c2b437d
--- /dev/null
+++ b/Installer/FilelistMacOSPPC.java.skel
@@ -0,0 +1,11 @@
+
+public class FilelistMacOSPPC
+ implements FilelistOS
+{
+ public static final String version = "_MAJV_._MINV_._BUGV_._RELV_";
+
+ public static final String archiv = "../binpkg/libGL4Java_MAJV_._MINV_._BUGV_._RELV_-MacOS-os9-ppc.zip";
+
+ public String getVersion() { return version; }
+ public String getArchiv() { return archiv; }
+}
diff --git a/Installer/FilelistOS.java b/Installer/FilelistOS.java
new file mode 100644
index 0000000..6210212
--- /dev/null
+++ b/Installer/FilelistOS.java
@@ -0,0 +1,6 @@
+
+public interface FilelistOS
+{
+ public String getVersion() ;
+ public String getArchiv() ;
+}
diff --git a/Installer/FilelistPNGArchiv.java b/Installer/FilelistPNGArchiv.java
new file mode 100644
index 0000000..211782f
--- /dev/null
+++ b/Installer/FilelistPNGArchiv.java
@@ -0,0 +1,11 @@
+
+public class FilelistPNGArchiv
+ implements FilelistOS
+{
+ public static final String version = "1.0a";
+
+ public static final String archiv = "../binpkg/png-1.0a-jar.zip";
+
+ public String getVersion() { return version; }
+ public String getArchiv() { return archiv; }
+}
diff --git a/Installer/FilelistPNGClasses.java b/Installer/FilelistPNGClasses.java
new file mode 100644
index 0000000..181b9d6
--- /dev/null
+++ b/Installer/FilelistPNGClasses.java
@@ -0,0 +1,11 @@
+
+public class FilelistPNGClasses
+ implements FilelistOS
+{
+ public static final String version = "1.0a";
+
+ public static final String archiv = "../binpkg/png-1.0a-classes.zip";
+
+ public String getVersion() { return version; }
+ public String getArchiv() { return archiv; }
+}
diff --git a/Installer/FilelistSGIIrix62Mips.java.skel b/Installer/FilelistSGIIrix62Mips.java.skel
new file mode 100644
index 0000000..6a176e9
--- /dev/null
+++ b/Installer/FilelistSGIIrix62Mips.java.skel
@@ -0,0 +1,11 @@
+
+public class FilelistSGIIrix62Mips
+ implements FilelistOS
+{
+ public static final String version = "_MAJV_._MINV_._BUGV_._RELV_";
+
+ public static final String archiv = "../binpkg/libGL4Java_MAJV_._MINV_._BUGV_._RELV_-SGI-IRIX-65-mips.zip";
+
+ public String getVersion() { return version; }
+ public String getArchiv() { return archiv; }
+}
diff --git a/Installer/FilelistSUNSolaris26Sparc.java.skel b/Installer/FilelistSUNSolaris26Sparc.java.skel
new file mode 100644
index 0000000..363adf6
--- /dev/null
+++ b/Installer/FilelistSUNSolaris26Sparc.java.skel
@@ -0,0 +1,11 @@
+
+public class FilelistSUNSolaris26Sparc
+ implements FilelistOS
+{
+ public static final String version = "_MAJV_._MINV_._BUGV_._RELV_";
+
+ public static final String archiv = "../binpkg/libGL4Java_MAJV_._MINV_._BUGV_._RELV_-SUNOS-57-sparc.zip";
+
+ public String getVersion() { return version; }
+ public String getArchiv() { return archiv; }
+}
diff --git a/Installer/FilelistTool.java b/Installer/FilelistTool.java
new file mode 100644
index 0000000..d0cd715
--- /dev/null
+++ b/Installer/FilelistTool.java
@@ -0,0 +1,66 @@
+
+public class FilelistTool
+{
+ public static final FilelistOS GetMyInstance(MachineCtrl mctrl)
+ {
+ if(mctrl==null)
+ return null;
+ if(mctrl.isWin32)
+ {
+ if(mctrl.osArch.indexOf("x86")>=0)
+ {
+ return new FilelistWin32I386();
+ }
+ return null;
+ }
+ if(mctrl.isUnix)
+ {
+ if(mctrl.unixFlavor==mctrl.unixFlavor_Linux)
+ {
+ if(mctrl.osArch.indexOf("x86")>=0 ||
+ mctrl.osArch.indexOf("i86")>=0 ||
+ mctrl.osArch.indexOf("i686")>=0 ||
+ mctrl.osArch.indexOf("i586")>=0 ||
+ mctrl.osArch.indexOf("i486")>=0 ||
+ mctrl.osArch.indexOf("i386")>=0
+ )
+ {
+ System.out.println("GLVendor: "+mctrl.glVendor);
+ if(mctrl.glVendor!=null)
+ {
+ if(mctrl.glVendor.indexOf("generic")>=0)
+ return new FilelistLinuxI386GlibcXF86();
+ }
+ return new FilelistLinuxI386GlibcXF86();
+ } else if(mctrl.osArch.indexOf("ppc")>=0)
+ {
+ System.out.println("GLVendor: "+mctrl.glVendor);
+ if(mctrl.glVendor!=null)
+ {
+ if(mctrl.glVendor.indexOf("generic")>=0)
+ return new FilelistLinuxPPCGlibcXF86();
+ }
+ return new FilelistLinuxPPCGlibcXF86();
+ }
+ } else if(mctrl.unixFlavor==mctrl.unixFlavor_Solaris)
+ {
+ if(mctrl.osArch.indexOf("sparc")>=0)
+ return new FilelistSUNSolaris26Sparc();
+ } else if(mctrl.unixFlavor==mctrl.unixFlavor_Irix)
+ {
+ if(mctrl.osArch.indexOf("mips")>=0)
+ return new FilelistSGIIrix62Mips();
+ } else if(mctrl.unixFlavor==mctrl.unixFlavor_HPUX)
+ {
+ if(mctrl.osArch.indexOf("pa_risc")>=0)
+ return new FilelistHPUXPaRisc();
+ }
+ }
+ if(mctrl.isMacOs)
+ {
+ if(mctrl.osArch.indexOf("powerpc")>=0)
+ return new FilelistMacOSPPC();
+ }
+ return null;
+ }
+}
diff --git a/Installer/FilelistWin32I386.java.skel b/Installer/FilelistWin32I386.java.skel
new file mode 100644
index 0000000..0b10312
--- /dev/null
+++ b/Installer/FilelistWin32I386.java.skel
@@ -0,0 +1,11 @@
+
+public class FilelistWin32I386
+ implements FilelistOS
+{
+ public String version = "_MAJV_._MINV_._BUGV_._RELV_";
+
+ public String archiv = "../binpkg/libGL4Java_MAJV_._MINV_._BUGV_._RELV_-Win32-x86.zip";
+
+ public String getVersion() { return version; }
+ public String getArchiv() { return archiv; }
+}
diff --git a/Installer/FilelistWin95I386OpenGL.java b/Installer/FilelistWin95I386OpenGL.java
new file mode 100644
index 0000000..d3ccd68
--- /dev/null
+++ b/Installer/FilelistWin95I386OpenGL.java
@@ -0,0 +1,11 @@
+
+public class FilelistWin95I386OpenGL
+ implements FilelistOS
+{
+ public String version = "opengl95";
+
+ public String archiv = "../binpkg/libOpenGL1.2-Win95-i386.zip";
+
+ public String getVersion() { return version; }
+ public String getArchiv() { return archiv; }
+}
diff --git a/Installer/GL4JInst.html b/Installer/GL4JInst.html
new file mode 100644
index 0000000..b84fd7e
--- /dev/null
+++ b/Installer/GL4JInst.html
@@ -0,0 +1,24 @@
+<HTML>
+<HEAD>
+<title>GL4Java Installation</title>
+
+<SCRIPT LANGUAGE="JavaScript">
+function do_redirect()
+{
+ var ua = navigator.userAgent;
+ if (ua.indexOf("MSIE") >= 0)
+ {
+ window.location.replace("GL4JInst_ie_check.html");
+ }
+ else
+ {
+ window.location.replace("GL4JInst_cacert_ns.html");
+ }
+}
+</SCRIPT>
+
+</HEAD>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff" onLoad="do_redirect()">
+GL4Java Installation
+</BODY>
+</HTML>
diff --git a/Installer/GL4JInst.java b/Installer/GL4JInst.java
new file mode 100644
index 0000000..d29f16c
--- /dev/null
+++ b/Installer/GL4JInst.java
@@ -0,0 +1,730 @@
+/**
+ * @(#) GL4JInst.java
+ * @(#) author: Ronald B. Cemer, Sven Goethel
+ * @(#) copyright: Copyright (c) 1999 Ronald B. Cemer under GNU GPL
+ * @(#) version: 2.00
+ */
+
+import java.applet.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.io.*;
+import java.net.*;
+import java.util.*;
+import java.util.zip.*;
+import java.lang.reflect.*;
+
+public class GL4JInst
+ extends Applet
+ implements Runnable, WindowListener, ActionListener
+{
+ boolean isAnApplet = true;
+ URL codeBase = null;
+
+ static private final String gl4javaWWW =
+ "http://www.jausoft.com/Files/Java/1.1.X/GL4Java/Installer";
+
+ static private final String version = "2.04";
+
+ static private final String cannot_install_title =
+ "Cannot install GL4Java";
+ static private final String gl4java_not_installed_string =
+ "*** GL4Java INSTALLATION HAS FAILED ***";
+
+ // Status display:
+ private TextArea statustextarea = null;
+
+ // Popup window:
+ private Frame errorframe = null;
+ private TextArea errortextarea = null;
+ private Button errorokbutton = null;
+
+ Button bFinish = null;
+
+ // Misc:
+ private Thread myThread = null;
+ private String archive = null;
+ private String gl4j_archive = null;
+ private String glutfont_archive = null;
+ private boolean install_opengl = false;
+ private String opengl_archive = null;
+ private String png_archive = null;
+ private String gl_lib = null;
+ private String glu_lib = null;
+ private Vector lib_dir_list = null;
+ private String targetDirs[] = null;
+ private URL gl4javaURL = null;
+ private URL sourceURL = null;
+ private boolean initfailed = false;
+ private String initfailedreason = null;
+ private String tryrefresh = new String("");;
+
+ private MachineCtrl mctrl = null;
+
+ private String errstr = null;
+ boolean ok=true;
+
+ FilelistOS osFileLists = null;
+ FilelistWin95I386OpenGL osFileWin95OpenGL = new FilelistWin95I386OpenGL();
+ FilelistGL4JClasses fileGL4JClasses= new FilelistGL4JClasses();
+ FilelistGL4JArchiv fileGL4JArchiv= new FilelistGL4JArchiv();
+ FilelistGLUTFontClasses fileGLUTFontClasses= new FilelistGLUTFontClasses();
+ FilelistGLUTFontArchiv fileGLUTFontArchiv= new FilelistGLUTFontArchiv();
+ FilelistPNGClasses filePNGClasses= new FilelistPNGClasses();
+ FilelistPNGArchiv filePNGArchiv= new FilelistPNGArchiv();
+
+ /* Initialize the applet */
+
+
+ public void init()
+ {
+ // Create the status text area.
+ setLayout(new BorderLayout());
+ statustextarea = new TextArea();
+ statustextarea.setEditable(false);
+ statustextarea.setLocation(0,0);
+ statustextarea.setSize(getSize().width,getSize().height);
+ add("Center", statustextarea);
+ if(!isAnApplet)
+ {
+ bFinish = new Button("Quit");
+ bFinish.setActionCommand("quit");
+ bFinish.addActionListener(this);
+ add("South", bFinish);
+ try {
+ String current_dir = System.getProperty("user.dir");
+ if(current_dir!=null)
+ {
+ current_dir=current_dir.replace('\\','/');
+ if(!current_dir.endsWith("/"))
+ current_dir=current_dir+"/";
+ if(!current_dir.startsWith("/"))
+ current_dir="/"+current_dir;
+ codeBase = new URL ("file://"+current_dir);
+ gl4javaURL = new URL (gl4javaWWW);
+ }
+ } catch (Exception e) {
+ System.out.println("could not convert the current directory to a code-base !\n"+e);
+ }
+ } else {
+ codeBase = getCodeBase();
+ }
+
+ mctrl = new MachineCtrl("GL4Java Installation");
+ ok = mctrl.isError()==false;
+
+ if(!ok)
+ {
+ errstr=mctrl.errstr;
+ statustextarea.setText
+ (statustextarea.getText() + errstr +"\n");
+ return;
+ }
+ }
+
+
+ public void start()
+ {
+ if (!ok)
+ {
+ statustextarea.setText
+ (statustextarea.getText() + mctrl.errstr +"\n");
+ return;
+ }
+ mctrl.enablePrivilege();
+ if(mctrl.isError())
+ {
+ statustextarea.setText
+ (statustextarea.getText() + mctrl.errstr +"\n");
+ mctrl.clearError();
+ }
+ mctrl.fetchPrivilegedInfos();
+ if(mctrl.isError())
+ {
+ statustextarea.setText
+ (statustextarea.getText() + mctrl.errstr +"\n");
+ mctrl.clearError();
+ }
+ osFileLists = FilelistTool.GetMyInstance(mctrl);
+ if(osFileLists==null)
+ {
+ statustextarea.setText
+ (statustextarea.getText() +
+ "No Package Found for:\n"+
+ "Java VM vendor is: " + mctrl.jvmVendor + "\n" +
+ "OS: "+
+ mctrl.osName+" "+mctrl.osVersion+" "+mctrl.osArch+"\n");
+ ok=false;
+ } else {
+
+ String[] descrText = {
+ "GL4Java Installer Version "+ getAppletInfo(),
+ "GL4Java Classes Version "+FilelistGL4JClasses.version,
+ "GL4Java Native-Libs Version "+osFileLists.getVersion(),
+ "------------------------------------------------------------"};
+
+ mctrl.machineOptionWindow(this, descrText, "Start Installation",
+ (isAnApplet==true)?this:null);
+
+ if(mctrl.isError())
+ {
+ statustextarea.setText
+ (statustextarea.getText() + mctrl.errstr +"\n");
+ mctrl.clearError();
+ }
+ }
+ }
+
+ public void startInstallation()
+ {
+ if (!ok)
+ {
+ statustextarea.setText
+ (statustextarea.getText() + mctrl.errstr +"\n");
+ return;
+ }
+ osFileLists = FilelistTool.GetMyInstance(mctrl);
+ if(osFileLists==null)
+ {
+ statustextarea.setText
+ (statustextarea.getText() +
+ "No Package Found for:\n"+
+ "Java VM vendor is: " + mctrl.jvmVendor + "\n" +
+ "OS: "+
+ mctrl.osName+" "+mctrl.osVersion+" "+mctrl.osArch+"\n");
+ ok=false;
+ }
+ myThread = new Thread(this);
+ myThread.start();
+ }
+
+
+ public void stop()
+ {
+ // Don't stop until we're done.
+ while (myThread != null)
+ {
+ try
+ {
+ Thread.currentThread().sleep(100);
+ }
+ catch (Exception e)
+ { }
+ }
+ }
+
+
+ public void destroy()
+ {
+ }
+
+
+ public String getAppletInfo()
+ {
+ return version + " (c) 1999 Ronald B. Cemer & Sven Goethel";
+ }
+
+
+ public String[][] getParameterInfo()
+ {
+ String s[][] =
+ {
+ { "sourcedir", "URL", "directory containing installable files (overrides default zip files)" },
+ };
+ return s;
+ }
+
+
+ /* This is the run() method of the
+ thread which does the actual work. */
+
+
+ public void run()
+ {
+
+ if(ok)
+ {
+
+ Cursor oldCursor = getCursor();
+ setCursor(new Cursor(Cursor.WAIT_CURSOR));
+
+ // Initialize values for replaceable strings.
+ statustextarea.setText
+ (statustextarea.getText() +
+ "GL4Java Installer Version "+ getAppletInfo()+"\n"+
+ "GL4Java Classes Version "+FilelistGL4JClasses.version+"\n"+
+ "GL4Java Native-Libs Version "+osFileLists.getVersion()+"\n\n");
+
+ // Check for existence of GL and GLU libraries.
+ String fixstring = "";
+ lib_dir_list = new Vector();
+ if (mctrl.isWin32)
+ {
+ gl_lib = "OPENGL32.DLL";
+ glu_lib = "GLU32.DLL";
+ if (mctrl.os_lib_dir != null)
+ lib_dir_list.addElement(new String(mctrl.os_lib_dir));
+ fixstring =
+ "\n" +
+ "\n" +
+ "If you are running the first release of Windows 95, your\n" +
+ "system may not have OpenGL functionality. You can download\n" +
+ "OpenGL from the following URL:\n" +
+ " ftp://ftp.microsoft.com/softlib/MSLFILES/OPENGL95.EXE\n" +
+ "Be sure to save the file to an empty directory, then extract\n" +
+ "its contents using WinZip or another zip extractor, then copy\n" +
+ "the OPENGL32.DLL and GLU32.DLL files into your WINDOWS\\SYSTEM\n" +
+ "directory. Then return to this web page and run the GL4Java\n" +
+ "installation again.\n" +
+ "\n" +
+ "If you are running NT 4.0, you must have Service Pack 3 or\n" +
+ "later installed in order for your system to support OpenGL.\n" +
+ "NT 4.0 service packs can be downloaded from:\n" +
+ " www.microsoft.com/downloads\n";
+ }
+ else if (mctrl.isMacOs)
+ {
+ // TODO !!!
+ gl_lib = "GL.DLL";
+ glu_lib = "GLU.DLL";
+ if (mctrl.os_lib_dir != null)
+ lib_dir_list.addElement(new String(mctrl.os_lib_dir));
+ fixstring =
+ "\n" +
+ "\n" +
+ "Your system does not appear to have OpenGL functionality.\n" +
+ "You can download OpenGL for the Macintosh from the following URL:\n" +
+ " http://www.apple.com/opengl/\n" +
+ "Follow their installation instructions to install OpenGL.\n" +
+ "Then return to this web page and run the GL4Java installation\n" +
+ "again.";
+ }
+ else if (mctrl.isUnix)
+ {
+ gl_lib = "libGL.so";
+ glu_lib = "libGLU.so";
+ lib_dir_list.addElement(new String("/lib"));
+ lib_dir_list.addElement(new String("/usr/lib"));
+ lib_dir_list.addElement(new String("/usr/X11/lib"));
+ lib_dir_list.addElement(new String("/usr/X11R6/lib"));
+ lib_dir_list.addElement(new String("/usr/local/lib"));
+ fixstring =
+ "\n" +
+ "\n" +
+ "Your system does not appear to have OpenGL functionality.\n" +
+ "You can probably find a version of Mesa3D (a free OpenGL\n" +
+ "clone) at the following URL:\n" +
+ " http://www.mesa3d.org/\n" +
+ "Follow their installation instructions to install Mesa3D.\n" +
+ "Then return to this web page and run the GL4Java installation\n" +
+ "again.";
+ }
+
+ if ( (ok)
+ && (gl_lib != null)
+ && (gl_lib.length() > 0)
+ && (lib_dir_list != null)
+ && (lib_dir_list.size() > 0) )
+ {
+ if (!FileTool.libraryExists(mctrl,gl_lib,lib_dir_list))
+ {
+ if (mctrl.isWin95)
+ install_opengl = true;
+ else
+ {
+ ok = false;
+ statustextarea.setText
+ (statustextarea.getText() +
+ cannot_install_title+"\n"+
+ "GL4Java cannot be installed because\n" +
+ "the OpenGL library:\n" +
+ " " + gl_lib + "\n" +
+ "cannot be found." + fixstring);
+ return;
+ }
+ }
+ }
+
+ if ( (ok)
+ && (glu_lib != null)
+ && (glu_lib.length() > 0)
+ && (lib_dir_list != null)
+ && (lib_dir_list.size() > 0) )
+ {
+ if (!FileTool.libraryExists(mctrl,glu_lib,lib_dir_list))
+ {
+ if (mctrl.isWin95)
+ install_opengl = true;
+ else
+ {
+ ok = false;
+ statustextarea.setText
+ (statustextarea.getText() +
+ "GL4Java cannot be installed because\n" +
+ "the GLU library:\n" +
+ " " + glu_lib + "\n" +
+ "cannot be found." + fixstring);
+ return;
+ }
+ }
+ }
+ setCursor(oldCursor);
+ }
+
+ if (ok)
+ {
+ statustextarea.setText
+ (statustextarea.getText() +
+ "done.\n" +
+ "Java VM vendor is: " + mctrl.jvmVendor + "\n" +
+ "OS: "+
+ mctrl.osName+" "+mctrl.osVersion+" "+mctrl.osArch+"\n");
+ statustextarea.setText
+ (statustextarea.getText() +
+ "Classes will be installed to: " +
+ mctrl.browser_classes + "\n");
+ statustextarea.setText
+ (statustextarea.getText() +
+ "Native libraries will be installed to: " +
+ mctrl.browser_natives +"\n");
+
+ if (mctrl.isWin32)
+ {
+ if (mctrl.isWin95)
+ {
+ opengl_archive = osFileWin95OpenGL.getArchiv() ;
+ }
+ if(mctrl.isMicrosoftJvm)
+ {
+ gl4j_archive = fileGL4JClasses.getArchiv();
+ glutfont_archive = fileGLUTFontClasses.getArchiv();
+ png_archive = filePNGClasses.getArchiv();
+ } else {
+ gl4j_archive = fileGL4JArchiv.getArchiv();
+ glutfont_archive = fileGLUTFontArchiv.getArchiv();
+ png_archive = filePNGArchiv.getArchiv();
+ }
+ } else {
+ gl4j_archive = fileGL4JArchiv.getArchiv();
+ glutfont_archive = fileGLUTFontArchiv.getArchiv();
+ png_archive = filePNGArchiv.getArchiv();
+ }
+ archive = osFileLists.getArchiv();
+
+
+ // Install OpenGL if needed.
+
+ if ( ok
+ && (install_opengl)
+ && (opengl_archive != null)
+ && (opengl_archive.length() > 0) )
+ {
+ if(!isAnApplet && !FileTool.fileExists(mctrl, opengl_archive))
+ {
+ statustextarea.setText
+ (statustextarea.getText() +
+ "Getting File(s): OpenGL for Win95\n");
+
+ ok = FileTool.copyFileFromDir(mctrl,
+ gl4javaURL,
+ opengl_archive, opengl_archive,
+ statustextarea);
+ }
+ if(ok)
+ {
+ statustextarea.setText
+ (statustextarea.getText() +
+ "Install OpenGL for Win95\n");
+ try
+ {
+ sourceURL = new URL(codeBase,opengl_archive);
+ }
+ catch (Exception e)
+ {
+ ok=false;
+ statustextarea.setText
+ (statustextarea.getText() +
+ "File does not exist: "+codeBase+","+opengl_archive+" !\n");
+ }
+ }
+ if(ok)
+ {
+ targetDirs = new String[1];
+ targetDirs[0] = mctrl.os_lib_dir;
+ ok = FileTool.copyFilesFromZip
+ (mctrl, sourceURL, targetDirs, statustextarea);
+ }
+ }
+
+ // Now install the GL4Java files.
+
+ if ( ok
+ && (gl4j_archive != null)
+ && (gl4j_archive.length() > 0) )
+ {
+ if(!isAnApplet && !FileTool.fileExists(mctrl, gl4j_archive))
+ {
+ statustextarea.setText
+ (statustextarea.getText() +
+ "Getting File(s): GL4Java Java Classes\n");
+
+ ok = FileTool.copyFileFromDir(mctrl,
+ gl4javaURL,
+ gl4j_archive, gl4j_archive,
+ statustextarea);
+ }
+ if(ok)
+ {
+ statustextarea.setText
+ (statustextarea.getText() +
+ "Install GL4Java Java Classes\n");
+ try
+ {
+ sourceURL = new URL(codeBase,gl4j_archive);
+ }
+ catch (Exception e)
+ {
+ ok=false;
+ statustextarea.setText
+ (statustextarea.getText() +
+ "File does not exist: "+codeBase+","+gl4j_archive+" !\n");
+ }
+ }
+ if(ok)
+ {
+ targetDirs = new String[1];
+ targetDirs[0] = mctrl.browser_classes;
+ ok = FileTool.copyFilesFromZip
+ (mctrl, sourceURL, targetDirs,statustextarea);
+ }
+ }
+
+ if ( ok
+ && mctrl.installGLUTFontSupport
+ && (glutfont_archive != null)
+ && (glutfont_archive.length() > 0) )
+ {
+ if(!isAnApplet && !FileTool.fileExists(mctrl, glutfont_archive))
+ {
+ statustextarea.setText
+ (statustextarea.getText() +
+ "Getting File(s): GL4Java GLUT-FONT Java Classes\n");
+
+ ok = FileTool.copyFileFromDir(mctrl,
+ gl4javaURL,
+ glutfont_archive, glutfont_archive,
+ statustextarea);
+ }
+ if(ok)
+ {
+ statustextarea.setText
+ (statustextarea.getText() +
+ "Install GL4Java GLUT-FONT Java Classes\n");
+ try
+ {
+ sourceURL = new URL(codeBase,glutfont_archive);
+ }
+ catch (Exception e)
+ {
+ ok=false;
+ statustextarea.setText
+ (statustextarea.getText() +
+ "File does not exist: "+codeBase+","+glutfont_archive+" !\n");
+ }
+ }
+ if(ok)
+ {
+ targetDirs = new String[1];
+ targetDirs[0] = mctrl.browser_classes;
+ ok = FileTool.copyFilesFromZip
+ (mctrl, sourceURL, targetDirs,statustextarea);
+ }
+ }
+
+ if ( ok
+ && (png_archive != null)
+ && (png_archive.length() > 0) )
+ {
+ if(!isAnApplet && !FileTool.fileExists(mctrl, png_archive))
+ {
+ statustextarea.setText
+ (statustextarea.getText() +
+ "Getting File(s): PNG Java Classes\n");
+
+ ok = FileTool.copyFileFromDir(mctrl,
+ gl4javaURL,
+ png_archive, png_archive,
+ statustextarea);
+ }
+ if(ok)
+ {
+ statustextarea.setText
+ (statustextarea.getText() +
+ "Install PNG Java Classes\n");
+ try
+ {
+ sourceURL = new URL(codeBase,png_archive);
+ }
+ catch (Exception e)
+ {
+ ok=false;
+ statustextarea.setText
+ (statustextarea.getText() +
+ "File does not exist: "+codeBase+","+png_archive+" !\n");
+ }
+ }
+ if(ok)
+ {
+ targetDirs = new String[1];
+ targetDirs[0] = mctrl.browser_classes;
+ ok = FileTool.copyFilesFromZip
+ (mctrl, sourceURL, targetDirs,statustextarea);
+ }
+ }
+
+ if ( ok
+ && (archive != null)
+ && (archive.length() > 0) )
+ {
+ if(!isAnApplet && !FileTool.fileExists(mctrl, archive))
+ {
+ statustextarea.setText
+ (statustextarea.getText() +
+ "Getting File(s): GL4Java Native Libs\n");
+
+ ok = FileTool.copyFileFromDir(mctrl,
+ gl4javaURL,
+ archive, archive,
+ statustextarea);
+ }
+ if(ok)
+ {
+ statustextarea.setText
+ (statustextarea.getText() +
+ "Install GL4Java Native Libs\n");
+ try
+ {
+ sourceURL = new URL(codeBase,archive);
+ }
+ catch (Exception e)
+ {
+ ok=false;
+ statustextarea.setText
+ (statustextarea.getText() +
+ "File does not exist: "+codeBase+","+archive+" !\n");
+ }
+ }
+ if(ok)
+ {
+ targetDirs = new String[1];
+ targetDirs[0] = mctrl.browser_natives;
+ ok = FileTool.copyFilesFromZip
+ (mctrl, sourceURL, targetDirs,statustextarea);
+ }
+ }
+ } else {
+ statustextarea.setText
+ (statustextarea.getText() +
+ "GL4Java cannot be installed because\n" +
+ "your combination of browser, Java Virtual\n" +
+ "Machine and operating system may not currently.\n" +
+ "supported.\n" +
+ "\n" +
+ "Operating system: " + mctrl.osName + "\n" +
+ "Java VM vendor..: " + mctrl.jvmVendor + "\n" +
+ gl4java_not_installed_string);
+ }
+
+ statustextarea.setText
+ (statustextarea.getText() +
+ (ok==false ? "*** INSTALLATION FAILED ***\n" : "done.\n"));
+
+ if (ok)
+ {
+ statustextarea.setText
+ (statustextarea.getText() +
+ "The GL4Java libraries have been\n" +
+ "successfully installed on your\n" +
+ "system.\n" +
+ "\n" +
+ "Please restart your browser!\n"+
+ "\n" +
+ "You should now be able to run 3D web\n" +
+ "applets which use GL4Java.");
+ if(isAnApplet)
+ showStatus("Installation complete! Please restart your browser!");
+ } else if(isAnApplet)
+ showStatus("Installation failed!");
+
+ myThread = null;
+ }
+
+ public void windowActivated(WindowEvent e)
+ {
+ }
+
+ public void windowClosed(WindowEvent e)
+ {
+ }
+
+ public void windowClosing(WindowEvent e)
+ {
+ }
+
+ public void windowDeactivated(WindowEvent e)
+ {
+ }
+
+ public void windowDeiconified(WindowEvent e)
+ {
+ }
+
+ public void windowIconified(WindowEvent e)
+ {
+ }
+
+ public void windowOpened(WindowEvent e)
+ {
+ }
+
+ /* ActionListener methods used to kill errorframe and its contents: */
+
+ public void actionPerformed(ActionEvent e)
+ {
+ if (e.getActionCommand().equals("quit"))
+ {
+ stop();
+ if(myThread == null && !isAnApplet)
+ if(mctrl!=null && mctrl.dialog==null)
+ System.exit(0);
+
+ }
+ if (e.getActionCommand().equals("Start Installation"))
+ {
+ if(mctrl.dialog!=null)
+ {
+ mctrl.dialog.setVisible(false);
+ mctrl.dialog.dispose();
+ mctrl.dialog=null;
+ }
+ startInstallation();
+ }
+ }
+
+ public static void main( String args[] )
+ {
+ Frame mainFrame = new Frame("GL4Java Installation");
+
+ GL4JInst applet = new GL4JInst();
+
+ applet.isAnApplet=false;
+ applet.setSize(400, 600);
+ applet.init();
+ applet.start();
+
+ mainFrame.add(applet);
+
+ mainFrame.pack();
+ mainFrame.setVisible(true);
+ }
+}
diff --git a/Installer/GL4JInst_cacert_ns.html b/Installer/GL4JInst_cacert_ns.html
new file mode 100644
index 0000000..8601bc6
--- /dev/null
+++ b/Installer/GL4JInst_cacert_ns.html
@@ -0,0 +1,58 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
+ <title>GL4Java installation</title>
+<script LANGUAGE="JavaScript">
+function do_redirect()
+{
+ var ua = navigator.userAgent;
+ if (ua.indexOf("MSIE") >= 0)
+ {
+ window.location.replace("GL4JInst_ie_check.html");
+ }
+}
+</script>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff" onLoad="do_redirect()">
+<B> Warning ! New certificate ! </B>
+<br>
+Before you can begin the GL4Java installation under
+Netscape, you must first must:
+<br>&nbsp;&nbsp;&nbsp;<b>- delete the old certificate and</b>
+<br>&nbsp;&nbsp;&nbsp;<b>- re-import the new signing certificate.</b>
+<br>
+<br>
+To delete the old certificate, open the Netscape dialog:
+<br>&nbsp;&nbsp;&nbsp;<I>Communicator.Tools.Security</I>
+<br>Then click on <I>Certificates.Signers</I> and delete the old GL4Java
+certificate !
+<br>
+<br>
+The certificate enables
+the GL4Java installer to install the required GL4Java software components
+on your system.
+<br>
+<p><b>Import the signing certificate</b>, while using the link below.
+<p>A dialog box will pop up.
+<br>
+<p>When the "Accept this Certificate Authority for Certifying software
+developers" box comes up:
+<br>&nbsp;&nbsp;&nbsp; BE SURE THIS BOX CONTAINS A CHECK MARK.&nbsp; FAILURE
+TO PUT A CHECK MARK IN
+<br>&nbsp;&nbsp;&nbsp; THIS BOX WILL RESULT IN FAILURE TO INSTALL THE GL4JAVA
+LIBRARIES.
+<p>When the "Warn me before sending information to sites certified by this
+Certificate Authority" box comes up:
+<br>&nbsp;&nbsp;&nbsp; BE SURE THIS BOX CONTAINS A CHECK MARK.&nbsp; THIS
+IS AN EXTRA SECURITY PRECAUTION.
+<p>When asked for a name, enter the following name, exactly as shown: GL4Java
+<br>
+<p><b><a href="x509.crt">Click here to import the signing certificate.</a> Sat Aug 19, 2000 - Sun Nov 19, 2000 </b>
+<br>
+<p>After you have imported the certificate, <b><a href="GL4JInst_ns.html">Click
+here to begin the GL4Java installation.</a></b>
+<br>&nbsp;
+</body>
+</html>
diff --git a/Installer/GL4JInst_f13plugin.html b/Installer/GL4JInst_f13plugin.html
new file mode 100644
index 0000000..fc8da8c
--- /dev/null
+++ b/Installer/GL4JInst_f13plugin.html
@@ -0,0 +1,44 @@
+<HTML>
+<HEAD>
+<TITLE>GL4Java installation</TITLE>
+
+</HEAD>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+<hr>
+<!--"CONVERTED_APPLET"-->
+<!-- CONVERTER VERSION 1.3 -->
+<SCRIPT LANGUAGE="JavaScript"><!--
+ var _info = navigator.userAgent; var _ns = false;
+ var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0);
+//--></SCRIPT>
+<COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!--
+ var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0)));
+//--></SCRIPT></COMMENT>
+
+<SCRIPT LANGUAGE="JavaScript"><!--
+ if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 500 HEIGHT = 400 codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"><NOEMBED><XMP>');
+ else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.3" CODE = "GL4JInst.class" ARCHIVE = "GL4JInstaller.jar" WIDTH = 500 HEIGHT = 400 scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"><NOEMBED><XMP>');
+//--></SCRIPT>
+<APPLET CODE = "GL4JInst.class" ARCHIVE = "GL4JInstaller.jar" WIDTH = 500 HEIGHT = 400></XMP>
+<PARAM NAME = CODE VALUE = "GL4JInst.class" >
+<PARAM NAME = ARCHIVE VALUE = "GL4JInstaller.jar" >
+
+<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
+<PARAM NAME="scriptable" VALUE="false">
+
+</APPLET>
+
+</NOEMBED></EMBED></OBJECT>
+
+
+<!--
+<APPLET CODE = "GL4JInst.class" ARCHIVE = "GL4JInstaller.jar" WIDTH = 500 HEIGHT = 400>
+
+
+</APPLET>
+-->
+<!--"END_CONVERTED_APPLET"-->
+
+<hr>
+</BODY>
+</HTML>
diff --git a/Installer/GL4JInst_fie.html b/Installer/GL4JInst_fie.html
new file mode 100644
index 0000000..c431d08
--- /dev/null
+++ b/Installer/GL4JInst_fie.html
@@ -0,0 +1,13 @@
+<HTML>
+<HEAD>
+<TITLE>GL4Java installation</TITLE>
+
+</HEAD>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+<hr>
+<applet code="GL4JInst.class" width=500 height=400>
+<param name="cabbase" value="GL4JInst.cab">
+</applet>
+<hr>
+</BODY>
+</HTML>
diff --git a/Installer/GL4JInst_fns.html b/Installer/GL4JInst_fns.html
new file mode 100644
index 0000000..b1629b0
--- /dev/null
+++ b/Installer/GL4JInst_fns.html
@@ -0,0 +1,12 @@
+<HTML>
+<HEAD>
+<TITLE>GL4Java installation</TITLE>
+
+</HEAD>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+<hr>
+<applet code="GL4JInst.class" archive="GL4JInst_ns.jar" width=500 height=400>
+</applet>
+<hr>
+</BODY>
+</HTML>
diff --git a/Installer/GL4JInst_fstd.html b/Installer/GL4JInst_fstd.html
new file mode 100644
index 0000000..0859955
--- /dev/null
+++ b/Installer/GL4JInst_fstd.html
@@ -0,0 +1,12 @@
+<HTML>
+<HEAD>
+<TITLE>GL4Java installation</TITLE>
+
+</HEAD>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+<hr>
+<applet code="GL4JInst.class" archive="GL4JInstaller.jar" width=500 height=400>
+</applet>
+<hr>
+</BODY>
+</HTML>
diff --git a/Installer/GL4JInst_ie.html b/Installer/GL4JInst_ie.html
new file mode 100644
index 0000000..3e16a81
--- /dev/null
+++ b/Installer/GL4JInst_ie.html
@@ -0,0 +1,24 @@
+<HTML>
+<HEAD>
+<TITLE>GL4Java installation</TITLE>
+
+<SCRIPT LANGUAGE="JavaScript">
+function do_redirect()
+{
+ var ua = navigator.userAgent;
+ if (ua.indexOf("MSIE") < 0)
+ {
+ window.location.replace("GL4JInst_cacert_ns.html");
+ }
+}
+</SCRIPT>
+
+</HEAD>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff" onLoad="do_redirect()">
+<hr>
+<applet code="GL4JInst.class" width=500 height=400>
+<param name="cabbase" value="GL4JInst.cab">
+</applet>
+<hr>
+</BODY>
+</HTML>
diff --git a/Installer/GL4JInst_ie_check.html b/Installer/GL4JInst_ie_check.html
new file mode 100644
index 0000000..40e18f9
--- /dev/null
+++ b/Installer/GL4JInst_ie_check.html
@@ -0,0 +1,41 @@
+<HTML>
+<HEAD>
+<TITLE>GL4Java installation</TITLE>
+
+<SCRIPT LANGUAGE="JavaScript">
+function do_redirect()
+{
+ var ua = navigator.userAgent;
+ if (ua.indexOf("MSIE") < 0)
+ {
+ window.location.replace("GL4JInst_cacert_ns.html");
+ }
+}
+</SCRIPT>
+
+</HEAD>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff" onLoad="do_redirect()">
+<hr>
+<p><u>For Win32 &amp; InternetExplorer Users Only</u></center>
+Be sure to have the MS-JavaVirtualMachine build 3186 or later installed !
+<br>
+<br>If you have java enabled, please have a look in the applet field below !!
+<br>
+<br>Otherwise check your Java Console (under the View menu) -
+<br>it should say something like
+<br>"Microsoft (R) VM for Java, 5.0 Release 5.0.0.3186".
+<br>If the last four digits are 3186 or above, you are fine.
+<br>
+<br>Get the new JVM direct from the Microsoft-Webside, if necessary:
+<br><br><a href="http://www.microsoft.com/java/vm/dl_vm40.htm">http://www.microsoft.com/java/vm/dl_vm40.htm</a>.
+<br><a href="http://www.microsoft.com/java/">http://www.microsoft.com/java/</a>.
+<hr>
+<applet code="MSJVMVersionApplet.class" width=500 height=100>
+</applet>
+<hr>
+<br>
+<p>If your MS-JVM version is fine, <b><a href="GL4JInst_ie.html">Click
+here to begin the GL4Java installation.</a></b>
+<br>&nbsp;
+</BODY>
+</HTML>
diff --git a/Installer/GL4JInst_ns.html b/Installer/GL4JInst_ns.html
new file mode 100644
index 0000000..dc3df6f
--- /dev/null
+++ b/Installer/GL4JInst_ns.html
@@ -0,0 +1,23 @@
+<HTML>
+<HEAD>
+<TITLE>GL4Java installation</TITLE>
+
+<SCRIPT LANGUAGE="JavaScript">
+function do_redirect()
+{
+ var ua = navigator.userAgent;
+ if (ua.indexOf("MSIE") >= 0)
+ {
+ window.location.replace("GL4JInst_ie.html");
+ }
+}
+</SCRIPT>
+
+</HEAD>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff" onLoad="do_redirect()">
+<hr>
+<applet code="GL4JInst.class" archive="GL4JInst_ns.jar" width=500 height=400>
+</applet>
+<hr>
+</BODY>
+</HTML>
diff --git a/Installer/MSJVMVersionApplet.java b/Installer/MSJVMVersionApplet.java
new file mode 100644
index 0000000..f48e458
--- /dev/null
+++ b/Installer/MSJVMVersionApplet.java
@@ -0,0 +1,33 @@
+
+import java.awt.*;
+import java.util.*;
+import java.awt.event.*;
+import java.applet.*;
+
+public class MSJVMVersionApplet extends Applet
+{
+ public void init()
+ {
+ Properties props =
+ com.ms.util.SystemVersionManager.getVMVersion();
+ String build = props.getProperty("BuildIncrement");
+ int buildI = 0;
+ try {
+ buildI = Integer.valueOf(build).intValue();
+ } catch (Exception ex) {}
+ String descr = props.getProperty("Description");
+ setLayout(new BorderLayout());
+ String state = null;
+ if(buildI>=3186)
+ state = "!!!! YOUR MS-JVM VERSION LOOKS FINE !!!!";
+ else
+ state = "!!!! YOUR MS-JVM VERSION IS TOO OLD, PLEASE UPDATE !!!!";
+ TextArea text = new TextArea(
+ descr + "." + build + "\n"+
+ "Build: " + build + "\n\n" + state);
+
+ add("Center", text);
+
+ setBackground(Color.white);
+ }
+}
diff --git a/Installer/MachineCtrl.java b/Installer/MachineCtrl.java
new file mode 100644
index 0000000..cba487a
--- /dev/null
+++ b/Installer/MachineCtrl.java
@@ -0,0 +1,988 @@
+import java.lang.*;
+import java.awt.*;
+import java.applet.*;
+import java.awt.event.*;
+import java.io.*;
+import java.net.*;
+import java.util.*;
+import java.util.zip.*;
+import java.lang.reflect.*;
+
+
+public class MachineCtrl
+ implements ActionListener, ItemListener
+{
+
+ public String title = null;
+ Frame dialog = null;
+ public Button goToJausoftGL4Java = null;
+ public Button buttonOk = null;
+ public Button buttonCancel = null;
+ public Button buttonFileClasses = null;
+ public Button buttonFileNatives = null;
+ public TextField tf_browser_classes = null;
+ public TextField tf_browser_natives = null;
+ private Choice glVendorChoice = null;
+ public String glVendor = null;
+ public boolean installGLUTFontSupport = true;
+ private Checkbox checkboxInstallGLUTFontSupport = null;
+
+ // Values for replaceable strings:
+ public String browser_classes = null;
+ public String browser_natives = null;
+ public String os_dir = null;
+ public String os_lib_dir = null;
+
+ // Java VM vendor and operating system stuff:
+ public String jvmVendor = null;
+ public String jvmVersion = null;
+ public boolean isNetscapeJvm = false;
+ public boolean isSunJvm = false;
+ public boolean isMacJvm = false;
+ public boolean isMicrosoftJvm = false;
+
+ public String osName = null;
+ public String osVersion = null;
+ public String osArch = null;
+ public boolean isWin32 = false;
+ public boolean isWin95 = false;
+ public boolean isMacOs = false;
+ public boolean isMacOs9 = false;
+ public boolean isUnix = false;
+ public int unixFlavor = unixFlavor_Unknown;
+ static public final int
+ unixFlavor_Unknown = 0,
+ unixFlavor_Linux = 1,
+ unixFlavor_Solaris = 2,
+ unixFlavor_Aix = 3,
+ unixFlavor_Irix = 4,
+ unixFlavor_HPUX = 5;
+
+ private String pathsep = null;
+ private String filesep = null;
+
+ public String controlKey = null;
+ public String refreshButton = null;
+ public String refreshInfo = null;
+ public String errstr = null;
+
+ Applet applet = null;
+
+ public boolean isError()
+ { return errstr!=null; }
+
+ public void clearError()
+ { errstr=null; }
+
+ public MachineCtrl(String title)
+ {
+ this.title = title;
+
+ // Query Java VM vendor and operating system.
+ jvmVendor = java.lang.System.getProperty("java.vendor").toLowerCase();
+ jvmVersion = java.lang.System.getProperty("java.version").toLowerCase();
+
+ osName = System.getProperty("os.name").toLowerCase();
+ osVersion = System.getProperty("os.version").toLowerCase();
+ osArch = System.getProperty("os.arch").toLowerCase();
+
+ isNetscapeJvm = ( (jvmVendor!=null) && (jvmVendor.indexOf("netscape")>=0) );
+ isSunJvm = ( (jvmVendor!=null) && (jvmVendor.indexOf("sun")>=0) );
+ isMacJvm = ( (jvmVendor!=null) && (jvmVendor.indexOf("apple")>=0) );
+ isMicrosoftJvm = ( (jvmVendor!=null) && (jvmVendor.indexOf("microsoft")>=0) );
+ if( !isNetscapeJvm && !isMicrosoftJvm )
+ {
+ isSunJvm=true; // default, also for mac ...
+ }
+
+ isWin32 = osName.startsWith("wind");
+ isWin95 =
+ ( (isWin32)
+ && (osName.indexOf("windows 95") >= 0)
+ && (osVersion.startsWith("4.0")) );
+
+ isMacOs = osName.startsWith("mac os");
+ isMacOs9 = osVersion.startsWith("9.");
+
+ isUnix = ( (!isWin32) && (!isMacOs) );
+
+ pathsep = System.getProperty("path.separator");
+ filesep = System.getProperty("file.separator");
+
+ if (isUnix)
+ {
+ if (osName.indexOf("linux") >= 0)
+ unixFlavor = unixFlavor_Linux;
+ else if (osName.indexOf("solaris") >= 0)
+ unixFlavor = unixFlavor_Solaris;
+ else if (osName.indexOf("aix") >= 0)
+ unixFlavor = unixFlavor_Aix;
+ else if (osName.indexOf("irix") >= 0)
+ unixFlavor = unixFlavor_Irix;
+ else if (osName.indexOf("hp-ux") >= 0)
+ unixFlavor = unixFlavor_HPUX;
+ }
+ System.out.println("Machine Info:");
+ System.out.println("\tosName: "+osName);
+ System.out.println("\tosVersion: "+osVersion);
+ System.out.println("\tosArch: "+osArch);
+ System.out.println("");
+ System.out.println("jvmVendor: "+jvmVendor);
+ System.out.println("jvmVersion: "+jvmVersion);
+ System.out.println("");
+ System.out.println("pathsep: "+pathsep);
+ System.out.println("filesep: "+filesep);
+ System.out.println("");
+ System.out.println("End of Machine Info !");
+
+ // Fail if unsupported VM.
+ if ( (!isNetscapeJvm) && (!isMicrosoftJvm) && (!isSunJvm) )
+ {
+ errstr = new String
+ ("GL4Java cannot be installed because\n" +
+ "your Java Virtual Machine is not recognized\n" +
+ "by the installer.\n" +
+ "\n" +
+ "Operating system: " + osName + "\n" +
+ "Java VM vendor..: " + jvmVendor + "\n" +
+ "Java VM version..: " + jvmVersion + "\n" +
+ "\n" +
+ "NOTE: You must be running Netscape Communicator\n" +
+ " or Microsoft Internet Explorer to install\n" +
+ " GL4Java.");
+ }
+
+ // Fail if unsupported operating system.
+ if ( (isUnix) && (unixFlavor == unixFlavor_Unknown) )
+ {
+ errstr = new String
+ ("GL4Java cannot be installed because\n" +
+ "your operating system is not recognized\n" +
+ "by the installer.\n" +
+ "\n" +
+ "Operating system: " + osName + "\n" +
+ "Java VM vendor..: " + jvmVendor +"\n" +
+ "Java VM version..: " + jvmVersion );
+ }
+
+ {
+ if (isNetscapeJvm || isSunJvm)
+ {
+ controlKey = new String("Shift");
+ refreshButton = new String("Reload");
+ }
+ else if (isMicrosoftJvm)
+ {
+ controlKey = new String("Ctrl");
+ refreshButton = new String("Refresh");
+ }
+ if ( (controlKey != null) && (refreshButton != null) )
+ {
+ refreshInfo = new String
+ ("\n\n" +
+ "Under some circumstances, a failed\n" +
+ "installation can be corrected by\n" +
+ "holding down the " + controlKey + " key and\n" +
+ "clicking the " + refreshButton + " button on your\n" +
+ "browser's command bar.");
+ }
+ }
+ }
+
+ public boolean enablePrivilege()
+ {
+ // Attempt to assert the needed permissions.
+ if (isNetscapeJvm)
+ {
+ try
+ {
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalFileAccess");
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalExecAccess");
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalConnect");
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalFdRead");
+ }
+ catch (Exception e)
+ {
+ errstr = new String
+ ("Netscape denied privileges, or a failure occurred.\n"+
+ "Here is the exception that was caught:\n"+e+"\n");
+ return false;
+ }
+ }
+ else if (isMicrosoftJvm)
+ {
+ try
+ {
+ com.ms.security.PolicyEngine.assertPermission (com.ms.security.PermissionID.FILEIO);
+ com.ms.security.PolicyEngine.assertPermission
+ (com.ms.security.PermissionID.PROPERTY);
+ com.ms.security.PolicyEngine.assertPermission
+ (com.ms.security.PermissionID.SYSTEM);
+ }
+ catch (Exception e)
+ {
+ errstr = new String
+ ("Microsoft VM denied privileges, or a failure occurred.\n"+
+ "Here is the exception that was caught:\n"+e+"\n");
+ return false;
+ }
+ }
+ return true;
+ }
+
+
+ public boolean fetchPrivilegedInfos()
+ {
+ if (isNetscapeJvm)
+ {
+ try
+ {
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalFileAccess");
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalExecAccess");
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalConnect");
+ netscape.security.PrivilegeManager.enablePrivilege
+ ("UniversalFdRead");
+ }
+ catch (Exception e)
+ {
+ errstr = new String
+ ("Netscape denied privileges, or a failure occurred.\n"+
+ "Here is the exception that was caught:\n"+e+"\n");
+ return false;
+ }
+ }
+ else if (isMicrosoftJvm)
+ {
+ try
+ {
+ com.ms.security.PolicyEngine.assertPermission (com.ms.security.PermissionID.FILEIO);
+ com.ms.security.PolicyEngine.assertPermission
+ (com.ms.security.PermissionID.PROPERTY);
+ com.ms.security.PolicyEngine.assertPermission
+ (com.ms.security.PermissionID.SYSTEM);
+ }
+ catch (Exception e)
+ {
+ errstr = new String
+ ("Microsoft VM denied privileges, or a failure occurred.\n"+
+ "Here is the exception that was caught:\n"+e+"\n");
+ return false;
+ }
+ }
+ if (isMicrosoftJvm)
+ {
+ if (isWin32)
+ {
+ int buflen = 1024;
+ StringBuffer buf = null;
+ int len = 0;
+
+ Class[] parameterTypes = null;
+ Method m = null;
+ Object args[] = null;
+ File f = null;
+
+ try
+ {
+ Class kernel32 = Class.forName("com.ms.win32.Kernel32");
+ try
+ {
+ parameterTypes = new Class[2];
+ parameterTypes[0] = Class.forName("java.lang.StringBuffer");
+ parameterTypes[1] = Integer.TYPE;
+ m = kernel32.getMethod("GetWindowsDirectory",parameterTypes);
+ args = new Object[2];
+ buf = new StringBuffer(buflen+1);
+ buf.setLength(buflen);
+ args[0] = buf;
+ args[1] = new Integer(buflen);
+ len = ((Integer)m.invoke(kernel32,args)).intValue();
+ buf.setLength(len);
+ f = new File(new String(buf));
+ os_dir = f.getAbsolutePath().replace('\\','/');
+ browser_classes = os_dir + "/JAVA/trustlib";
+ }
+ catch (Exception e)
+ {
+ browser_classes = null;
+ System.out.println(e);
+ System.out.println("call to get the win dir failed:\n"+ buf);
+ }
+ try
+ {
+ parameterTypes = new Class[2];
+ parameterTypes[0] = Class.forName("java.lang.StringBuffer");
+ parameterTypes[1] = Integer.TYPE;
+ m = kernel32.getMethod("GetSystemDirectory",parameterTypes);
+ args = new Object[2];
+ buf = new StringBuffer(buflen+1);
+ buf.setLength(buflen);
+ args[0] = buf;
+ args[1] = new Integer(buflen);
+ len = ((Integer)m.invoke(kernel32,args)).intValue();
+ f = new File(new String(buf));
+ os_lib_dir = f.getAbsolutePath().replace('\\','/');
+ browser_natives = os_lib_dir;
+ }
+ catch (Exception e)
+ {
+ browser_natives = null;
+ System.out.println(e);
+ System.out.println("call to get the sys dir failed:\n"+ buf);
+ }
+ }
+ catch (Exception e2)
+ {
+ System.out.println(e2);
+ browser_classes = null;
+ browser_natives = null;
+ }
+ if ( (browser_classes == null) || (browser_natives == null) )
+ {
+ errstr = new String (
+ "Hmmm...Looks as if you may have an early version of\n" +
+ "IE 4, or perhaps even a version older than IE 4.\n" +
+ "Because the installer is not able to get the\n" +
+ "privileges it needs, the installation will be\n" +
+ "aborted.\n" +
+ "\n" +
+ "If you DID receive a question about security but\n" +
+ "answered \"No\", you must hold down the Ctrl key\n" +
+ "and click on the browser's \"Refresh\" button, then\n" +
+ "answer \"Yes\" to the security question in order to\n" +
+ "grant the required privileges to the installer.\n" +
+ "\n" +
+ "If you did NOT receive a question about security, you\n" +
+ "should upgrade to the latest version of IE, then attempt\n" +
+ "the installation again. To do this, go to:\n" +
+ " http://www.microsoft.com/windows/ie/default.htm\n" +
+ "\n" +
+ "Operating system: " + osName + "\n" +
+ "Java VM vendor..: " + jvmVendor + "\n" );
+ return false;
+ }
+ } // if (isWin32)
+ else if (isMacOs)
+ {
+// TODO: Add IE init here for browser_classes and browser_natives directories
+// under MacOs.
+ } // if (isMacOs)
+ else if (isUnix)
+ {
+// TODO: Add IE init here for browser_classes and browser_natives directories
+// under Unix flavors.
+ } // if (isUnix)
+ } // if (isMicrosoftJvm)
+ else if (isNetscapeJvm || isSunJvm)
+ {
+ if (isWin32)
+ {
+ // Find WINDOWS and WINDOWS\SYSTEM directories for Win9x,
+ // or WINNT and WINNT\SYSTE23 directories for WinNT.
+ Process proc = null;
+ String path = "";
+ try
+ {
+ proc = Runtime.getRuntime().exec
+ ("COMMAND.COM /C ECHO %PATH%");
+ }
+ catch (Exception e)
+ { }
+ if (proc != null)
+ {
+ StringBuffer sb = new StringBuffer(4096);
+ sb.setLength(0);
+ try
+ {
+ InputStream is = proc.getInputStream();
+ int c;
+ int pos = 0;
+ while ((c = is.read()) != -1)
+ {
+ if ( (((char)c) == '\r') || (((char)c) == '\n') )
+ break;
+ sb.setLength(pos+1);
+ sb.setCharAt(pos,(char)c);
+ pos++;
+ }
+ }
+ catch (Exception e)
+ { }
+ if (sb.length() > 0) path = new String(sb);
+ }
+ if ( (path != null) && (path.length() > 0) )
+ {
+ while ( (path != null) && (path.length() > 0) )
+ {
+ int p = path.indexOf(pathsep);
+ String thispath = null;
+ if (p < 0)
+ {
+ thispath = path;
+ path = null;
+ }
+ else
+ {
+ thispath = path.substring(0,p);
+ if ((p+1) < path.length())
+ path = path.substring(p+1,path.length());
+ else
+ path = null;
+ }
+ if ( (thispath != null) && (thispath.length() > 0) )
+ {
+ File f = null;
+ thispath = thispath.replace('\\','/');
+ while (thispath.endsWith("/"))
+ {
+ if (thispath.length() > 1)
+ thispath = thispath.substring
+ (0,thispath.length()-1);
+ else
+ thispath = "";
+ }
+ f = new File(thispath+"/WIN.INI");
+ if (f.exists())
+ {
+ f = new File(thispath+"/SYSTEM.INI");
+ if (f.exists())
+ {
+ // Looks like a windows directory.
+ if ( (os_dir == null)
+ || (os_dir.length() < 1) )
+ os_dir = thispath;
+ // See if system or system32 exists and
+ // contains GL4JavaGljMSJDirect and
+ // (kernel32.dll or user32.dll).
+
+ String thispathA =thispath+"/SYSTEM";
+ String thispathB =thispath+"/system32";
+ String thispath2 = null;
+ boolean found = false;
+ String fname = null;
+ int i;
+
+ // check an existing GL4JavaGljMSJDirect
+ // to overwrite !
+ for (i = 0;
+ found == false && i < 2;
+ i++)
+ {
+ thispath2 =
+ (i == 0 ? thispathA : thispathB);
+
+ fname = thispath2 +
+ "/GL4JavaGljMSJDirect.dll";
+ f = new File (fname);
+
+ if (f.exists())
+ {
+ found=true;
+ System.out.println(fname + " found !!!");
+ } else
+ System.out.println(fname + " not found");
+ }
+
+ // if GL4JavaGljMSJDirect was never
+ // installed, find an appropiate path !
+ for (i = 0;
+ found == false && i < 2;
+ i++)
+ {
+ thispath2 =
+ (i == 0 ? thispathA : thispathB);
+
+ fname = thispath2 + "/KERNEL32.DLL";
+
+ f = new File (fname);
+
+ if (f.exists())
+ {
+ System.out.println(fname + " found !!!");
+ fname = thispath2 + "/USER32.DLL";
+ f = new File (fname);
+
+ if (f.exists())
+ {
+ // Looks like a windows/sytem
+ // or winnt/system32 directory.
+ System.out.println(fname + " found !!!");
+ found=true;
+ } else
+ System.out.println(fname + " not found");
+ } else
+ System.out.println(fname + " not found");
+ }
+ if(found)
+ {
+ if ( (os_lib_dir == null)
+ || (os_lib_dir.length()
+ < 1) )
+ os_lib_dir = thispath2;
+ }
+ }
+ }
+
+ // If there are two path separators, then
+ // it could be a windows system directory.
+ int idx = thispath.indexOf("/");
+ if (idx >= 0)
+ {
+ idx = thispath.indexOf("/",idx+1);
+ if (idx >= 0)
+ {
+ for (int i = 0; i < 2; i++)
+ {
+ f = new File
+ (thispath + "/KERNEL32.DLL");
+ if (f.exists())
+ {
+ f = new File
+ (thispath + "/USER32.DLL");
+ if (f.exists())
+ {
+ // Looks like a windows/sytem
+ // or winnt/system32 directory.
+ if ( (os_lib_dir == null)
+ || (os_lib_dir.length()
+ < 1) )
+ os_lib_dir = thispath;
+ if ( (os_dir == null)
+ || (os_dir.length() < 1) )
+ {
+ idx = thispath.lastIndexOf
+ ("/");
+ if (idx > 0)
+ os_dir = thispath.
+ substring(0,idx);
+ }
+ }
+ }
+ }
+
+ }
+ }
+ }
+ }
+ }
+ }
+ if ( (isWin32) || (isUnix) || (isMacOs) )
+ {
+ String classpath =
+ System.getProperty("java.class.path").replace('\\','/');
+ String javahome = System.getProperty("java.home");
+ if(javahome!=null)
+ {
+ javahome=javahome.replace('\\','/');
+ if(javahome.toLowerCase().endsWith("/jre"))
+ classpath+=pathsep+javahome+"/lib/ext/gl4java.jar";
+ }
+ if (classpath != null)
+ {
+ while ( (classpath != null) && (classpath.length() > 0) )
+ {
+ int p = classpath.indexOf(pathsep);
+ String thispath = null;
+ if (p < 0)
+ {
+ thispath = classpath;
+ classpath = null;
+ }
+ else
+ {
+ thispath = 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")
+ )
+ {
+ int lastpos = -1, newpos;
+ while ( (newpos =
+ thispath.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") )
+ {
+ browser_classes = new String(thispath);
+ if (isUnix)
+ {
+ switch (unixFlavor)
+ {
+ case unixFlavor_Linux:
+ browser_natives = new String("/usr/lib");
+ break;
+ case unixFlavor_Solaris:
+ browser_natives = new String("/usr/lib");
+ break;
+ case unixFlavor_Aix:
+ browser_natives = new String("/usr/lib");
+ break;
+ case unixFlavor_Irix:
+ browser_natives = new String("/usr/lib");
+ break;
+ }
+ }
+ else
+ browser_natives = thispath.substring(0,thispath.length()-7) + "bin";
+ break;
+ }
+ }
+ }
+ }
+ }
+ } // if ( (isWin32) || (isUnix) || (isMacOs) )
+ /*
+ else if (isMacOs)
+ {
+ }
+ */
+ } // if (isNetscapeJvm)
+
+ return true;
+ }
+
+ public void machineOptionWindow(ActionListener action,
+ String[] headerText,
+ String oktxt,
+ Applet _applet)
+ {
+ int i;
+ Panel panFlow = null;
+
+ applet = _applet;
+
+ dialog = new Frame (title);
+ dialog.setLayout(new BorderLayout());
+
+ if(headerText!=null && headerText.length>0)
+ {
+ Panel panNorth = new Panel();
+ panNorth.setLayout(new GridLayout(headerText.length+2,1));
+
+ for(i=0; i<headerText.length; i++)
+ {
+ panFlow = new Panel();
+ panFlow.setLayout(new FlowLayout(FlowLayout.LEFT,0,0));
+ panFlow.add(new Label(headerText[i]));
+ panNorth.add(panFlow);
+ }
+ panFlow = new Panel();
+ panFlow.setLayout(new FlowLayout(FlowLayout.LEFT,0,0));
+ panFlow.add((goToJausoftGL4Java = new Button("goto")));
+ goToJausoftGL4Java.addActionListener(this);
+ panFlow.add(new Label("http://www.jausoft.com/gl4java/"));
+ panNorth.add(panFlow);
+ panFlow = new Panel();
+ panFlow.setLayout(new FlowLayout(FlowLayout.LEFT,0,0));
+ panFlow.add(new Label("------------------------------------------------------------"));
+ panNorth.add(panFlow);
+
+ dialog.add("North", panNorth);
+ }
+
+ Panel panMain = new Panel();
+ panMain.setLayout(new GridLayout(10,1));
+
+ if(osVersion!=null && osArch!=null)
+ panMain.add(new Label("OS: "+osName+" "+osVersion+" "+osArch));
+ else
+ panMain.add(new Label("OS: none"));
+
+ panFlow = new Panel();
+ panFlow.setLayout(new FlowLayout(FlowLayout.LEFT,0,0));
+ panFlow.add(new Label("os-dir/os-library-dir:"));
+ if(os_dir!=null && os_lib_dir!=null)
+ panFlow.add(new Label(os_dir.trim()+"/"+os_lib_dir.trim()));
+ else
+ panFlow.add(new Label("none/none"));
+ panMain.add(panFlow);
+
+ Panel panGL4JSpecials = new Panel();
+ panGL4JSpecials.setLayout(new GridLayout(1,2));
+ installGLUTFontSupport = true;
+ checkboxInstallGLUTFontSupport = new Checkbox("with GLUT-Fonts", true);
+ checkboxInstallGLUTFontSupport.addItemListener(this);
+ panGL4JSpecials.add(checkboxInstallGLUTFontSupport);
+ panGL4JSpecials.add(new Label("(takes up to 200kBytes)"));
+ panMain.add(panGL4JSpecials);
+
+ Panel panOS = new Panel();
+ panOS.setLayout(new GridLayout(2,2));
+ Checkbox cb1 = new Checkbox("Win32", isWin32);
+ cb1.setEnabled(false);
+ panOS.add(cb1);
+ cb1 = new Checkbox("Win95", isWin95);
+ cb1.setEnabled(false);
+ panOS.add(cb1);
+ cb1 = new Checkbox("MacOS", isMacOs);
+ cb1.setEnabled(false);
+ panOS.add(cb1);
+ cb1 = new Checkbox("Unix", isUnix);
+ cb1.setEnabled(false);
+ panOS.add(cb1);
+ panMain.add(panOS);
+
+ if(isUnix)
+ {
+ Panel panOSUnix = new Panel();
+ panOSUnix.setLayout(new GridLayout(2,2));
+ cb1 = new Checkbox("GNU/Linux", unixFlavor==unixFlavor_Linux);
+ cb1.setEnabled(false);
+ panOSUnix.add(cb1);
+ cb1 = new Checkbox("Solaris", unixFlavor==unixFlavor_Solaris);
+ cb1.setEnabled(false);
+ panOSUnix.add(cb1);
+ cb1 = new Checkbox("Aix", unixFlavor==unixFlavor_Aix);
+ cb1.setEnabled(false);
+ panOSUnix.add(cb1);
+ cb1 = new Checkbox("Irix", unixFlavor==unixFlavor_Irix);
+ cb1.setEnabled(false);
+ panOSUnix.add(cb1);
+ panMain.add(panOSUnix);
+
+ if(unixFlavor==unixFlavor_Linux)
+ {
+ panFlow = new Panel();
+ panFlow.setLayout(new FlowLayout(FlowLayout.LEFT,0,0));
+ panFlow.add(new Label("OpenGL Vendor:"));
+ glVendorChoice = new Choice();
+ glVendorChoice.addItemListener(this);
+ glVendor = "generic";
+ glVendorChoice.add(glVendor);
+ panFlow.add(glVendorChoice);
+ panMain.add(panFlow);
+ }
+ }
+
+ if(jvmVendor!=null)
+ panMain.add(new Label("JVM: "+jvmVendor.trim()));
+ else
+ panMain.add(new Label("JVM: none"));
+
+ Panel panJVM = new Panel();
+ panJVM.setLayout(new GridLayout(1,3));
+ cb1 = new Checkbox("Sun", isSunJvm);
+ cb1.setEnabled(false);
+ panJVM.add(cb1);
+ cb1 = new Checkbox("Netscape", isNetscapeJvm);
+ cb1.setEnabled(false);
+ panJVM.add(cb1);
+ cb1 = new Checkbox("Microsoft", isMicrosoftJvm);
+ cb1.setEnabled(false);
+ panJVM.add(cb1);
+ panMain.add(panJVM);
+
+ panFlow = new Panel();
+ //panFlow.setLayout(new GridLayout(1,3));
+ panFlow.setLayout(new FlowLayout(FlowLayout.LEFT));
+ panFlow.add(new Label("Java-Classes Path:"));
+ tf_browser_classes = new TextField(browser_classes,60);
+ tf_browser_classes.addActionListener(this);
+ panFlow.add(tf_browser_classes);
+ buttonFileClasses = new Button("...");
+ buttonFileClasses.addActionListener(this);
+ panFlow.add(buttonFileClasses);
+ panMain.add(panFlow);
+ panFlow = new Panel();
+ //panFlow.setLayout(new GridLayout(1,3));
+ panFlow.setLayout(new FlowLayout(FlowLayout.LEFT));
+ panFlow.add(new Label("Native-Lib's-Path:"));
+ tf_browser_natives = new TextField(browser_natives,60);
+ tf_browser_natives.addActionListener(this);
+ panFlow.add(tf_browser_natives);
+ buttonFileNatives = new Button("...");
+ buttonFileNatives.addActionListener(this);
+ panFlow.add(buttonFileNatives);
+ panMain.add(panFlow);
+
+ dialog.add("Center", panMain);
+
+ Panel panButtons = new Panel();
+ buttonOk=new Button(oktxt);
+ buttonOk.setActionCommand(oktxt);
+ buttonOk.addActionListener(this);
+ if(action!=null)
+ buttonOk.addActionListener(action);
+ buttonCancel=new Button("Cancel");
+ buttonCancel.addActionListener(this);
+ panButtons.add(buttonOk);
+ panButtons.add(buttonCancel);
+
+ dialog.add("South", panButtons);
+ dialog.pack();
+ dialog.setVisible(true);
+ }
+
+ public boolean checkTextFields()
+ {
+ boolean ok = true;
+ String str = null;
+
+ try {
+ String fname;
+ fname = tf_browser_classes.getText().replace('\\','/');
+ fname = fname.trim();
+ File f = new File(fname);
+ if(f.exists() && f.isDirectory())
+ {
+ browser_classes = fname;
+ System.out.println("Set Classes-Dir to: "+
+ browser_classes);
+ } else {
+ str = new String ("directory <"+
+ tf_browser_classes.getText().trim()+
+ "> is invalid");
+ ok=false;
+ }
+ } catch (Exception ex) {
+ str = new String ("directory <"+
+ tf_browser_classes.getText().trim()+
+ "> is invalid\n"+ex);
+ ok=false;
+ }
+ try {
+ String fname;
+ fname = tf_browser_natives.getText().replace('\\','/');
+ fname = fname.trim();
+ File f = new File(fname);
+ if(f.exists() && f.isDirectory())
+ {
+ browser_natives = fname;
+ System.out.println("Set Native-Dir to: "+
+ browser_natives);
+ } else {
+ str = new String ("directory <"+
+ tf_browser_natives.getText().trim()+
+ "> is invalid");
+ ok=false;
+ }
+ } catch (Exception ex) {
+ str = new String ("directory <"+
+ tf_browser_natives.getText().trim()+
+ "> is invalid\n"+ex);
+ ok=false;
+ }
+ if(!ok && str!=null)
+ {
+ System.out.println("\007\n"+str+"\n");
+ }
+ return ok;
+ }
+
+ public void actionPerformed(ActionEvent e)
+ {
+ Object src = e.getSource();
+ if (src.equals(buttonOk) || src.equals(buttonCancel))
+ {
+ if (src.equals(buttonOk) && checkTextFields()==false)
+ return;
+ if(dialog!=null)
+ {
+ dialog.setVisible(false);
+ dialog.dispose();
+ dialog = null;
+ }
+ } else if(src.equals(tf_browser_classes))
+ {
+ checkTextFields();
+ } else if(src.equals(tf_browser_natives))
+ {
+ checkTextFields();
+ } else if(src.equals(buttonFileClasses))
+ {
+ FileDialog fd =
+ new FileDialog(dialog,"GL4Java Classes Dir",FileDialog.SAVE);
+ fd.setDirectory(tf_browser_classes.getText());
+ fd.show();
+ tf_browser_classes.setText(fd.getDirectory());
+ checkTextFields();
+ } else if(src.equals(buttonFileNatives))
+ {
+ FileDialog fd =
+ new FileDialog(dialog,"GL4Java Classes Dir",FileDialog.SAVE);
+ fd.setDirectory(tf_browser_natives.getText());
+ fd.show();
+ tf_browser_natives.setText(fd.getDirectory());
+ checkTextFields();
+ } else if(src.equals(goToJausoftGL4Java) && applet!=null)
+ {
+ try {
+ URL home = new URL("http://www.jausoft.com/gl4java/");
+ applet.getAppletContext().showDocument(home, "GL4Java Homepage");
+ } catch (Exception ex) {
+ applet.showStatus("cannot open http://www.jausoft.com/gl4java/");
+ }
+ }
+ }
+
+ public void itemStateChanged(ItemEvent e)
+ {
+ if(glVendorChoice!=null &&
+ glVendorChoice.equals(e.getItemSelectable()) &&
+ e.getStateChange()==ItemEvent.SELECTED
+ )
+ {
+ Object item = e.getItem();
+
+ // System.out.println("selected ITEM:"+item.getClass()+", "+item);
+
+ if(item instanceof String)
+ {
+ String str = (String)item;
+ glVendor = str;
+ }
+ } else if(checkboxInstallGLUTFontSupport.equals(e.getItemSelectable()))
+ {
+ installGLUTFontSupport =
+ checkboxInstallGLUTFontSupport.getState();
+ }
+
+ }
+
+ public static void main( String args[] )
+ {
+ MachineCtrl mctrl = new MachineCtrl("Test Class MachineCtrl");
+ if(mctrl.isError())
+ {
+ System.out.println(mctrl.errstr);
+ mctrl.clearError();
+ }
+ mctrl.enablePrivilege();
+ if(mctrl.isError())
+ {
+ System.out.println(mctrl.errstr);
+ mctrl.clearError();
+ }
+ mctrl.fetchPrivilegedInfos();
+ if(mctrl.isError())
+ {
+ System.out.println(mctrl.errstr);
+ mctrl.clearError();
+ }
+ String[] header = { "Info Text", "2nd Line" };
+ mctrl.machineOptionWindow(null, header, "exit", null);
+ if(mctrl.isError())
+ {
+ System.out.println(mctrl.errstr);
+ mctrl.clearError();
+ }
+ }
+}
+
diff --git a/Installer/README.txt b/Installer/README.txt
new file mode 100644
index 0000000..149fe71
--- /dev/null
+++ b/Installer/README.txt
@@ -0,0 +1,87 @@
+ GL4Java Installer
+ Copyright (c) 1999 Ronald B. Cemer
+
+You may use, redistribute, and/or modify this software under the terms of the
+GNU General Public License (GPL). GL4Java, which is included in binary form
+as part of this software, is covered under the GNU Library General Public
+License (LGPL).
+
+To see the GPL, visit:
+ http://www.gnu.org/copyleft/gpl.html
+To see the LGPL, visit:
+ http://www.gnu.org/copyleft/lgpl.html
+
+To generate a copy of the distributed files (files which should be deployed on
+a web server), run the following batch file (Win32 only):
+ makedist (path)
+where (path) is replaced by the path to a directory where the files are to be
+copied. Only the files required to deploy the installer on a web server will
+be copied to this directory. Be careful, though, since it does copy some HTML
+files. Any existing HTML files of the same name(s) in the target directory
+could be wiped out by this batch file. For safety's sake, it's probably best
+to copy the files to an empty directory first, instead of a directory on a
+live web server.
+
+For Netscape, there is an included x509.crt file, which must be imported into
+Netscape's certificate database by the user. Netscape comes pre-configured to
+know the correct MIME type for this file when loading it from local disk.
+There is, however, a special requirement when delivering the x509.crt via a
+web server. The MIME type for ".crt" files must be set properly. Some web
+servers come configured correctly for ".crt" files by default. For Apache web
+server, for example, you will need to add the following line to
+/etc/mime.types if isn't already there:
+ application/x-x509-ca-cert crt
+In order for the change to take effect, you may need to reboot, or at least
+stop and restart the web server.
+
+The GL4Java installer can read the files to be installed from zip files on the
+web server (the GL4JLibs*.zip files that are generated by running libarc.bat),
+or straight from a directory on the web server. By default, the GL4Java
+installer reads from GL4JLibs*.zip files on the web server.
+
+You can change the the source for these files to a subdirectory of your
+choosing (on the web server) by making the changes listed below. Note that
+"mysource" should be replaced with the name of a subdirectory into which
+the GL4JLibs*.zip files have been extracted. For example, if you wanted to
+copy files from a directory on the web server, you could make a subdirectory
+named "libs", then change to that directory and unzip the GL4JLibs*.zip files
+from there.
+
+*** IMPORTANT *** After unzipping under Unix, you must be sure that all
+directories under the libs directory are mode 755 in order for the web server
+to be able to read from them. Change to the newly created "libs" directory
+(or whatever you called it), and enter the following commands EXACTLY as
+shown here:
+ for i in `find . -type d -print`
+ do
+ chmod 755 $i
+ done
+
+Keep in mind that when you are copying from a directory, the files are not
+compressed so they will take longer to download via modem. For this reason,
+it is highly recommended that you use the supplied zip files.
+
+Here are the changes to the html files which are required in order to make the
+GL4Java installer read from a sudirectory (remember to replace mysource with
+the name of your subdirectory which contains the extracted GL4JLibs*.zip
+files).
+
+Changes to GL4JInst_ie.html:
+ old:
+ <applet code="GL4JInst.class" width=400 height=400>
+ <param name="cabbase" value="GL4JInst.cab">
+ </applet>
+ new:
+ <applet code="GL4JInst.class" width=400 height=400>
+ <param name="cabbase" value="GL4JInst.cab">
+ <param name="sourcedir" value="mysource">
+ </applet>
+
+Changes to GL4JInst_ns.html:
+ old:
+ <applet code="GL4JInst.class" archive="GL4JInst.jar" width=400 height=400>
+ </applet>
+ new:
+ <applet code="GL4JInst.class" archive="GL4JInst.jar" width=400 height=400>
+ <param name="sourcedir" value="mysource">
+ </applet>
diff --git a/Installer/index.html b/Installer/index.html
new file mode 100644
index 0000000..0eb405c
--- /dev/null
+++ b/Installer/index.html
@@ -0,0 +1,33 @@
+<html>
+<head>
+ <title>GL4Java Installation</title>
+</head>
+<BODY LINK="#0000ff" VLINK="#800080" BGCOLOR="#e6e6ff">
+This procedure will install the GL4Java classes and
+native libraries on your system.
+<p>Be sure to own local access rights, to save the native libraries and
+the java classes to your browsers directory !
+<center>
+<br>
+<hr>
+<p>After the Installation, you have to restart your browser application !
+<br>&nbsp;
+<p>If you are ready to begin, <a href="GL4JInst.html">Click here to start
+the setup procedure.</a>
+<br>
+(JavaScript is needed - does not work for MacOS !)
+</center>
+<hr>
+<br>&nbsp;
+<p><a href="java.policy">The Java2 policy file example to give GL4Java the permission to run under Java2 (sdk, jre, plugin) (Click here) !</a>
+<br>&nbsp;
+<hr>
+<br>&nbsp;
+<p><a href="GL4JInst_fstd.html">Force standard Appletviewer installation (Click here) !</a>
+<p><a href="GL4JInst_f13plugin.html">Force Java Plug-In 1.3 installation (Click here) !</a>
+<p><a href="GL4JInst_fns.html">Force Netscape installation (Click here) !</a>
+<p><a href="GL4JInst_fie.html">Force MS-IE installation (Click here) !</a>
+<br>&nbsp;
+<hr>
+</body>
+</html>
diff --git a/Installer/install.bat b/Installer/install.bat
new file mode 100644
index 0000000..fa1f2e7
--- /dev/null
+++ b/Installer/install.bat
@@ -0,0 +1,12 @@
+@echo off
+if "x%CLASSPATH%" == "x" goto nocpath
+ set xxCLASSPATH=%CLASSPATH%
+ set CLASSPATH=GL4JInstaller.jar;%CLASSPATH%
+ java GL4JInst
+ set CLASSPATH=%xxCLASSPATH%
+ goto finish
+:nocpath
+ set CLASSPATH=GL4JInstaller.jar
+ java GL4JInst
+ set CLASSPATH=
+:finish
diff --git a/Installer/install.sh b/Installer/install.sh
new file mode 100755
index 0000000..8f21663
--- /dev/null
+++ b/Installer/install.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ -z ${CLASSPATH:=""} ] ; then
+ CLASSPATH=GL4JInstaller.jar
+else
+ CLASSPATH=GL4JInstaller.jar:${CLASSPATH}
+fi
+export CLASSPATH
+exec java GL4JInst
diff --git a/Installer/java.policy b/Installer/java.policy
new file mode 100644
index 0000000..6a606f0
--- /dev/null
+++ b/Installer/java.policy
@@ -0,0 +1,51 @@
+//
+// GL4Java extensions get all permissions !
+//
+// This peace should be added on top of the file:
+//
+// If a Java2 SDK is used:
+// <java2-installation>/jre/lib/security/java.policy
+//
+// If a Java2 JRE is used:
+// <jre-installation>/lib/security/java.policy
+//
+// GL4Java Homepage:
+//
+// http://www.jausoft.com/gl4java/
+//
+
+grant codeBase "http://www.jausoft.com/Files/Java/1.1.X/GL4Java/Installer/*"
+{
+ permission java.security.AllPermission;
+};
+
+grant codeBase "http://www.jausoft.com/Files/Java/1.1.X/GL4Java/demos/*"
+{
+ permission java.security.AllPermission;
+};
+
+grant codeBase "http://www.jausoft.com/Files/Java/1.1.X/GL4Java/demos/MiscDemos/*
+{
+ permission java.security.AllPermission;
+};
+
+grant codeBase "http://www.jausoft.com/Files/Java/1.1.X/GL4Java/demos/RonsDemos/*
+{
+ permission java.security.AllPermission;
+};
+
+grant codeBase "http://www.jausoft.com/Files/Java/1.1.X/GL4Java/demos/SwingDemos/*
+{
+ permission java.security.AllPermission;
+};
+
+grant codeBase "http://www.jausoft.com/Files/Java/1.1.X/GL4Java/demos/GLLandScape/*
+{
+ permission java.security.AllPermission;
+};
+
+grant codeBase "http://www.jausoft.com/Files/Java/1.1.X/GL4Java/demos/HodglimsNeHe/*
+{
+ permission java.security.AllPermission;
+};
+
diff --git a/Installer/makeJar-Unix.sh b/Installer/makeJar-Unix.sh
new file mode 100755
index 0000000..ccfc58c
--- /dev/null
+++ b/Installer/makeJar-Unix.sh
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+. versiondef.sh
+
+
+rm -f *.class GL4JInstaller.jar
+
+javac -classpath ".:../capsapi_classes.zip" *.java
+
+. versionundef.sh
+
+rm -rf META-INF
+
+jar cf GL4JInstaller.jar *.class
+
+rm -f *.class
diff --git a/Installer/makeMSIESignedCab.sh b/Installer/makeMSIESignedCab.sh
new file mode 100755
index 0000000..dfb5f4c
--- /dev/null
+++ b/Installer/makeMSIESignedCab.sh
@@ -0,0 +1,19 @@
+#! /bin/sh
+
+. versiondef.sh
+
+# The Microsft signing keys were created using the Microsoft makecert and
+# cert2spc utilities, as follows:
+# makecert -nscp -r -n CN=GL4JInst GL4JInst.cer -sv GL4JInst.pvk
+# (when prompted for a password, click "None")
+# cert2spc GL4JInst.cer GL4JInst.spc
+
+rm -f *.class GL4JInst.cab
+//D/MSJAVASDK/BIN/jvc -nomessage -x- -cp:p .\;..\\CAPSAPI_CLASSES.ZIP *.java
+
+. versionundef.sh
+
+//D/MSJAVASDK/Bin/cabarc N GL4JInst.cab *.class
+# signcode -j javasign.dll -jp low -spc GL4JInst.spc -k GL4JInst GL4JInst.cab
+//D/MSJAVASDK/Bin/signcode -j javasign.dll -jp low -spc GL4JInstDemo.spc -v GL4JInstDemo.pvk GL4JInst.cab
+rm *.class
diff --git a/Installer/makeNetscapeSignedJar-Unix.sh b/Installer/makeNetscapeSignedJar-Unix.sh
new file mode 100755
index 0000000..d68c907
--- /dev/null
+++ b/Installer/makeNetscapeSignedJar-Unix.sh
@@ -0,0 +1,33 @@
+#! /bin/sh
+
+. versiondef.sh
+
+# The Netscape signing keys were created using the Netscape signtool
+# utility, as follows:
+# copy key3.db and cert7.db from one of the users directories.
+# signtool -d . -G GL4JInst204
+# Enter the following information:
+# certificate common name: GL4JInst204
+# organization: GL4Java Development Team
+# organization unit: GL4JInst
+# state or province: NRW
+# country (must be exactly 2 characters): DE
+# username: GL4JInst
+# email address: [email protected]
+# When the certificate has been created, copy x509.cacert to x509.crt using
+# the following command: copy x509.cacert x509.crt
+# Copy key3.db and cert7.db back to the users directories.
+
+cp ~/.netscape/key3.db .
+cp ~/.netscape/cert7.db .
+
+rm -f *.class GL4JInst_ns.jar
+javac -classpath ".:../capsapi_classes.zip" *.java
+
+. versionundef.sh
+
+rm -rf META-INF
+signtool -d . -e .class -k GL4JInst204 -Z GL4JInst_ns.jar -c9 --norecurse .
+rm -rf META-INF
+
+rm -f key3.db cert7.db *.class
diff --git a/Installer/makeNetscapeSignedJar-Win32.sh b/Installer/makeNetscapeSignedJar-Win32.sh
new file mode 100755
index 0000000..ba67d38
--- /dev/null
+++ b/Installer/makeNetscapeSignedJar-Win32.sh
@@ -0,0 +1,33 @@
+#! /bin/sh
+
+. versiondef.sh
+
+# The Netscape signing keys were created using the Netscape signtool
+# utility, as follows:
+# copy key3.db and cert7.db from one of the users directories.
+# signtool -d . -G GL4JInst204
+# Enter the following information:
+# certificate common name: GL4JInst204
+# organization: GL4Java Development Team
+# organization unit: GL4JInst
+# state or province: NRW
+# country (must be exactly 2 characters): DE
+# username: GL4JInst
+# email address: [email protected]
+# When the certificate has been created, copy x509.cacert to x509.crt using
+# the following command: copy x509.cacert x509.crt
+# Copy key3.db and cert7.db back to the users directories.
+
+cp ~/.netscape/key3.db .
+cp ~/.netscape/cert7.db .
+
+rm -f *.class GL4JInst_ns.jar
+javac -classpath ".;..\\capsapi_classes.zip" *.java
+rm -rf META-INF
+
+. versionundef.sh
+
+signtool -d . -e .class -k GL4JInst204 -Z GL4JInst_ns.jar -c9 --norecurse .
+rm -rf META-INF
+
+#rm -f key3.db cert7.db *.class
diff --git a/Installer/versiondef.sh b/Installer/versiondef.sh
new file mode 100644
index 0000000..2973f44
--- /dev/null
+++ b/Installer/versiondef.sh
@@ -0,0 +1,11 @@
+MAJV=2
+MINV=4
+BUGV=1
+RELV=0
+
+echo creating installer for version $MAJV.$MINV.$BUGV.$RELV !
+for i in *.skel ; do
+ sed -e "s/_MAJV_/$MAJV/g" -e "s/_MINV_/$MINV/g" -e "s/_BUGV_/$BUGV/g" \
+ -e "s/_RELV_/$RELV/g" $i > $(basename $i .skel)
+done
+
diff --git a/Installer/versionundef.sh b/Installer/versionundef.sh
new file mode 100644
index 0000000..a80d6b9
--- /dev/null
+++ b/Installer/versionundef.sh
@@ -0,0 +1,5 @@
+
+for i in *.skel ; do
+ rm -f $(basename $i .skel)
+done
+