diff options
author | Sven Gothel <[email protected]> | 2000-12-31 03:35:32 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2000-12-31 03:35:32 +0000 |
commit | 85604352f3aef219402a9f502851e71517d268bd (patch) | |
tree | 4e2a29e61fd1deb28f370f692a9b805cea9f639f | |
parent | 2214e0be5f2e124ebb5c661d0b0efc1191962f2a (diff) |
prepared for the Installer 2.06a
-rw-r--r-- | Installer/CHANGES.txt | 17 | ||||
-rw-r--r-- | Installer/CountedBufferedInputStream.java | 36 | ||||
-rw-r--r-- | Installer/FileTool.java | 36 | ||||
-rw-r--r-- | Installer/FilelistTool.java | 12 | ||||
-rw-r--r-- | Installer/GL4JInst.java | 65 | ||||
-rw-r--r-- | Installer/MachineCtrl.java | 39 | ||||
-rwxr-xr-x | Installer/makeNetscapeSignedJar-Win32.sh | 6 |
7 files changed, 148 insertions, 63 deletions
diff --git a/Installer/CHANGES.txt b/Installer/CHANGES.txt index bc990b3..831f225 100644 --- a/Installer/CHANGES.txt +++ b/Installer/CHANGES.txt @@ -12,13 +12,28 @@ This CHANGES starts with version 2.00 ! GL4Java Installer 2.00 is based upon version 1.05, by Ron Cemer ! -Last Changes: 21. November 2000 (Version 2.05b) +Last Changes: 31. Dezember 2000 (Version 2.06a) ----------------- TOP = new DOWN = old ----------------- +Dezember 31, 2000 (Version 2.06a): + + - Added a ProgressBar to the main Applet Panel ! + Thanxs to Andrea Fasce for his Idea of the overloaded + BufferedInputStream, which counts the read bytes ! + + - Removed the GLVendor stuff for Unices, + because it is no more needed since a long time. + + - Changed the Background color ;-) + +Dezember 28, 2000 (Version 2.05c): + + - Fixed security bug, while fetching the property "java.home" ! + November 21, 2000 (Version 2.05b): - Added J2RE (Java2 JRE) and Java 1.1 classpath support ! diff --git a/Installer/CountedBufferedInputStream.java b/Installer/CountedBufferedInputStream.java new file mode 100644 index 0000000..2d17441 --- /dev/null +++ b/Installer/CountedBufferedInputStream.java @@ -0,0 +1,36 @@ +
+import java.io.*;
+
+public class CountedBufferedInputStream extends BufferedInputStream
+{
+ public int totalLen;
+
+ public CountedBufferedInputStream(InputStream in)
+ {
+ super(in);
+ totalLen = 0;
+ }
+
+ public int read() throws IOException
+ {
+ totalLen++;
+ return super.read();
+ }
+
+ public int read(byte[] buf, int a, int b) throws IOException
+ {
+ int c = super.read(buf,a,b);
+ if(c!=-1) totalLen = totalLen+c;
+ return c;
+ }
+
+ public int read(byte[] buf) throws IOException
+ {
+ int c = super.read(buf);
+ if(c!=-1) totalLen += c;
+ return c;
+ }
+
+ public int getReadTotalLen()
+ { return totalLen; }
+}
diff --git a/Installer/FileTool.java b/Installer/FileTool.java index 49cc782..92b2233 100644 --- a/Installer/FileTool.java +++ b/Installer/FileTool.java @@ -242,7 +242,8 @@ public class FileTool public static final boolean copyFilesFromZip (MachineCtrl mctrl, URL zipURL, String targetDirs[], - TextArea statustextarea + TextArea statustextarea, + ProgressBar bar ) { int i, j; @@ -309,18 +310,29 @@ public class FileTool } ZipInputStream zis = null; + CountedBufferedInputStream cis = null; + int totalLength = 0; // Open the archive. try { - zis = new ZipInputStream(zipURL.openStream()); + URLConnection conn = zipURL.openConnection(); + conn.connect(); + totalLength = conn.getContentLength(); + bar.setMin(0); + bar.setMax(totalLength); + cis = new CountedBufferedInputStream(zipURL.openStream()); + zis = new ZipInputStream(cis); } catch (Exception e0) { if(statustextarea!=null) + { statustextarea.setText (statustextarea.getText() + "Cannot open file: " + zipURL + "\n"); + statustextarea.setCaretPosition(Integer.MAX_VALUE); + } return false; // Should never happen! } @@ -362,9 +374,12 @@ public class FileTool fos[i] = null; if(statustextarea!=null) + { statustextarea.setText (statustextarea.getText() + "Cannot create file: " + destFiles[i] + "\n"); + statustextarea.setCaretPosition(Integer.MAX_VALUE); + } ok= false; break; // breaks the beast ... } @@ -372,9 +387,12 @@ public class FileTool if(ok) if(statustextarea!=null) + { statustextarea.setText (statustextarea.getText() + "Installing source file: " + srcFile ); + statustextarea.setCaretPosition(Integer.MAX_VALUE); + } try { @@ -393,19 +411,21 @@ public class FileTool if (fos[i] != null) fos[i].write(buf,0,bytesread); } - if(statustextarea!=null) - statustextarea.setText - (statustextarea.getText() + "."); + if(bar!=null) + bar.setValue(cis.getReadTotalLen()); } catch (Exception e0) { // We got a write error. if(statustextarea!=null) + { statustextarea.setText (statustextarea.getText() + "\nCannot write file: " + destFiles[i] + "\n"); + statustextarea.setCaretPosition(Integer.MAX_VALUE); + } ok = false; continue; // breaks the beast ... @@ -416,8 +436,11 @@ public class FileTool { } // Should never happen! if(statustextarea!=null) + { statustextarea.setText (statustextarea.getText() + "\n"); + statustextarea.setCaretPosition(Integer.MAX_VALUE); + } for (j = 0; j < i; j++) { @@ -457,10 +480,13 @@ public class FileTool if(!ok) { if(statustextarea!=null) + { statustextarea.setText (statustextarea.getText() + "INSTALLATION INCOMPLETE !!\n"+ "Please check this log files for reasons !\n"); + statustextarea.setCaretPosition(Integer.MAX_VALUE); + } return false; } diff --git a/Installer/FilelistTool.java b/Installer/FilelistTool.java index d0cd715..c5a0c32 100644 --- a/Installer/FilelistTool.java +++ b/Installer/FilelistTool.java @@ -25,21 +25,9 @@ public class FilelistTool 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) diff --git a/Installer/GL4JInst.java b/Installer/GL4JInst.java index 6978050..4d7ac42 100644 --- a/Installer/GL4JInst.java +++ b/Installer/GL4JInst.java @@ -24,7 +24,7 @@ public class GL4JInst static private final String gl4javaWWW =
"http://www.jausoft.com/Files/Java/1.1.X/GL4Java/Installer";
- static private final String version = "2.05b";
+ static private final String version = "2.06a";
static private final String cannot_install_title =
"Cannot install GL4Java";
@@ -40,6 +40,9 @@ public class GL4JInst private Button errorokbutton = null;
Button bFinish = null;
+ ProgressBar bar = null;
+ Color jauBackgr = new Color(230, 230, 255);
+ Color jauForegr = new Color(0, 0, 255);
// Misc:
private Thread myThread = null;
@@ -78,19 +81,33 @@ public class GL4JInst public void init()
{
+ setBackground(jauBackgr);
// Create the status text area.
setLayout(new BorderLayout());
statustextarea = new TextArea();
+ statustextarea.setBackground(jauBackgr);
statustextarea.setEditable(false);
statustextarea.setLocation(0,0);
- statustextarea.setSize(getSize().width,getSize().height);
- add("Center", statustextarea);
+ statustextarea.setSize(getSize().width,getSize().height*2/3);
+ System.out.println("textarea size: "+statustextarea.getSize());
+ add(statustextarea, BorderLayout.CENTER);
+
+ bar = new ProgressBar();
+ bar.setSize(getSize().width,getSize().height*1/10);
+ System.out.println("bar size: "+bar.getSize());
+ bar.setMin(0);
+ bar.setMax(1000);
+ bar.setValue(0);
+ bar.setBackground(jauBackgr);
+ bar.setForeground(jauBackgr.darker().darker());
+ add(bar,BorderLayout.NORTH);
+
if(!isAnApplet)
{
bFinish = new Button("Quit");
bFinish.setActionCommand("quit");
bFinish.addActionListener(this);
- add("South", bFinish);
+ add(bFinish, BorderLayout.SOUTH);
try {
String current_dir = System.getProperty("user.dir");
if(current_dir!=null)
@@ -118,6 +135,7 @@ public class GL4JInst errstr=mctrl.errstr;
statustextarea.setText
(statustextarea.getText() + errstr +"\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
return;
}
}
@@ -129,6 +147,7 @@ public class GL4JInst {
statustextarea.setText
(statustextarea.getText() + mctrl.errstr +"\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
return;
}
mctrl.enablePrivilege();
@@ -136,6 +155,7 @@ public class GL4JInst {
statustextarea.setText
(statustextarea.getText() + mctrl.errstr +"\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
mctrl.clearError();
}
mctrl.fetchPrivilegedInfos();
@@ -143,6 +163,7 @@ public class GL4JInst {
statustextarea.setText
(statustextarea.getText() + mctrl.errstr +"\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
mctrl.clearError();
}
osFileLists = FilelistTool.GetMyInstance(mctrl);
@@ -154,6 +175,7 @@ public class GL4JInst "Java VM vendor is: " + mctrl.jvmVendor + "\n" +
"OS: "+
mctrl.osName+" "+mctrl.osVersion+" "+mctrl.osArch+"\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
ok=false;
} else {
@@ -170,6 +192,7 @@ public class GL4JInst {
statustextarea.setText
(statustextarea.getText() + mctrl.errstr +"\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
mctrl.clearError();
}
}
@@ -181,6 +204,7 @@ public class GL4JInst {
statustextarea.setText
(statustextarea.getText() + mctrl.errstr +"\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
return;
}
osFileLists = FilelistTool.GetMyInstance(mctrl);
@@ -192,6 +216,7 @@ public class GL4JInst "Java VM vendor is: " + mctrl.jvmVendor + "\n" +
"OS: "+
mctrl.osName+" "+mctrl.osVersion+" "+mctrl.osArch+"\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
ok=false;
}
myThread = new Thread(this);
@@ -254,6 +279,7 @@ public class GL4JInst "GL4Java Installer Version "+ getAppletInfo()+"\n"+
"GL4Java Classes Version "+FilelistGL4JClasses.version+"\n"+
"GL4Java Native-Libs Version "+osFileLists.getVersion()+"\n\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
// Check for existence of GL and GLU libraries.
String fixstring = "";
@@ -340,6 +366,7 @@ public class GL4JInst "the OpenGL library:\n" +
" " + gl_lib + "\n" +
"cannot be found." + fixstring);
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
return;
}
}
@@ -364,6 +391,7 @@ public class GL4JInst "the GLU library:\n" +
" " + glu_lib + "\n" +
"cannot be found." + fixstring);
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
return;
}
}
@@ -387,6 +415,7 @@ public class GL4JInst (statustextarea.getText() +
"Native libraries will be installed to: " +
mctrl.browser_natives +"\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
if (mctrl.isWin32)
{
@@ -424,6 +453,7 @@ public class GL4JInst statustextarea.setText
(statustextarea.getText() +
"Getting File(s): OpenGL for Win95\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
ok = FileTool.copyFileFromDir(mctrl,
gl4javaURL,
@@ -435,6 +465,7 @@ public class GL4JInst statustextarea.setText
(statustextarea.getText() +
"Install OpenGL for Win95\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
try
{
sourceURL = new URL(codeBase,opengl_archive);
@@ -445,6 +476,7 @@ public class GL4JInst statustextarea.setText
(statustextarea.getText() +
"File does not exist: "+codeBase+","+opengl_archive+" !\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
}
}
if(ok)
@@ -452,7 +484,7 @@ public class GL4JInst targetDirs = new String[1];
targetDirs[0] = mctrl.os_lib_dir;
ok = FileTool.copyFilesFromZip
- (mctrl, sourceURL, targetDirs, statustextarea);
+ (mctrl, sourceURL, targetDirs, statustextarea, bar);
}
}
@@ -467,6 +499,7 @@ public class GL4JInst statustextarea.setText
(statustextarea.getText() +
"Getting File(s): GL4Java Java Classes\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
ok = FileTool.copyFileFromDir(mctrl,
gl4javaURL,
@@ -478,6 +511,7 @@ public class GL4JInst statustextarea.setText
(statustextarea.getText() +
"Install GL4Java Java Classes\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
try
{
sourceURL = new URL(codeBase,gl4j_archive);
@@ -488,6 +522,7 @@ public class GL4JInst statustextarea.setText
(statustextarea.getText() +
"File does not exist: "+codeBase+","+gl4j_archive+" !\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
}
}
if(ok)
@@ -495,7 +530,7 @@ public class GL4JInst targetDirs = new String[1];
targetDirs[0] = mctrl.browser_classes;
ok = FileTool.copyFilesFromZip
- (mctrl, sourceURL, targetDirs,statustextarea);
+ (mctrl, sourceURL, targetDirs,statustextarea, bar);
}
}
@@ -509,6 +544,7 @@ public class GL4JInst statustextarea.setText
(statustextarea.getText() +
"Getting File(s): GL4Java GLUT-FONT Java Classes\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
ok = FileTool.copyFileFromDir(mctrl,
gl4javaURL,
@@ -520,6 +556,7 @@ public class GL4JInst statustextarea.setText
(statustextarea.getText() +
"Install GL4Java GLUT-FONT Java Classes\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
try
{
sourceURL = new URL(codeBase,glutfont_archive);
@@ -530,6 +567,7 @@ public class GL4JInst statustextarea.setText
(statustextarea.getText() +
"File does not exist: "+codeBase+","+glutfont_archive+" !\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
}
}
if(ok)
@@ -537,7 +575,7 @@ public class GL4JInst targetDirs = new String[1];
targetDirs[0] = mctrl.browser_classes;
ok = FileTool.copyFilesFromZip
- (mctrl, sourceURL, targetDirs,statustextarea);
+ (mctrl, sourceURL, targetDirs,statustextarea, bar);
}
}
@@ -550,6 +588,7 @@ public class GL4JInst statustextarea.setText
(statustextarea.getText() +
"Getting File(s): PNG Java Classes\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
ok = FileTool.copyFileFromDir(mctrl,
gl4javaURL,
@@ -561,6 +600,7 @@ public class GL4JInst statustextarea.setText
(statustextarea.getText() +
"Install PNG Java Classes\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
try
{
sourceURL = new URL(codeBase,png_archive);
@@ -571,6 +611,7 @@ public class GL4JInst statustextarea.setText
(statustextarea.getText() +
"File does not exist: "+codeBase+","+png_archive+" !\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
}
}
if(ok)
@@ -578,7 +619,7 @@ public class GL4JInst targetDirs = new String[1];
targetDirs[0] = mctrl.browser_classes;
ok = FileTool.copyFilesFromZip
- (mctrl, sourceURL, targetDirs,statustextarea);
+ (mctrl, sourceURL, targetDirs,statustextarea, bar);
}
}
@@ -591,6 +632,7 @@ public class GL4JInst statustextarea.setText
(statustextarea.getText() +
"Getting File(s): GL4Java Native Libs\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
ok = FileTool.copyFileFromDir(mctrl,
gl4javaURL,
@@ -602,6 +644,7 @@ public class GL4JInst statustextarea.setText
(statustextarea.getText() +
"Install GL4Java Native Libs\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
try
{
sourceURL = new URL(codeBase,archive);
@@ -612,6 +655,7 @@ public class GL4JInst statustextarea.setText
(statustextarea.getText() +
"File does not exist: "+codeBase+","+archive+" !\n");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
}
}
if(ok)
@@ -619,7 +663,7 @@ public class GL4JInst targetDirs = new String[1];
targetDirs[0] = mctrl.browser_natives;
ok = FileTool.copyFilesFromZip
- (mctrl, sourceURL, targetDirs,statustextarea);
+ (mctrl, sourceURL, targetDirs,statustextarea, bar);
}
}
} else {
@@ -633,11 +677,13 @@ public class GL4JInst "Operating system: " + mctrl.osName + "\n" +
"Java VM vendor..: " + mctrl.jvmVendor + "\n" +
gl4java_not_installed_string);
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
}
statustextarea.setText
(statustextarea.getText() +
(ok==false ? "*** INSTALLATION FAILED ***\n" : "done.\n"));
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
if (ok)
{
@@ -651,6 +697,7 @@ public class GL4JInst "\n" +
"You should now be able to run 3D web\n" +
"applets which use GL4Java.");
+ statustextarea.setCaretPosition(Integer.MAX_VALUE);
if(isAnApplet)
showStatus("Installation complete! Please restart your browser!");
} else if(isAnApplet)
diff --git a/Installer/MachineCtrl.java b/Installer/MachineCtrl.java index c6745ef..c2435e4 100644 --- a/Installer/MachineCtrl.java +++ b/Installer/MachineCtrl.java @@ -24,8 +24,6 @@ public class MachineCtrl 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; @@ -40,7 +38,6 @@ public class MachineCtrl public String jvmVersion = null; public int jvmVersionMajor = 1; // min. defaults public int jvmVersionMinor = 1; // min. defaults - public String jvmHome = null; public boolean isNetscapeJvm = false; public boolean isSunJvm = false; public boolean isMacJvm = false; @@ -85,7 +82,6 @@ public class MachineCtrl // Query Java VM vendor and operating system. jvmVendor = java.lang.System.getProperty("java.vendor").toLowerCase(); - jvmHome = java.lang.System.getProperty("java.home"); jvmVersion = java.lang.System.getProperty("java.version").toLowerCase(); int i0 = 0; @@ -153,6 +149,7 @@ public class MachineCtrl 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); @@ -162,7 +159,6 @@ public class MachineCtrl System.out.println("jvmVersion: "+jvmVersion+ "( major "+jvmVersionMajor+ ", minor "+jvmVersionMinor+")"); - System.out.println("jvmHome: "+jvmHome); System.out.println(""); System.out.println("pathsep: "+pathsep); System.out.println("filesep: "+filesep); @@ -607,6 +603,9 @@ public class MachineCtrl } } } + + String jvmHome = java.lang.System.getProperty("java.home"); + if ( (isWin32) || (isUnix) || (isMacOs) ) { if(DEBUG) @@ -732,6 +731,7 @@ public class MachineCtrl applet = _applet; dialog = new Frame (title); + dialog.setBackground(new Color(230, 230, 255)); dialog.setLayout(new BorderLayout()); if(headerText!=null && headerText.length>0) @@ -819,19 +819,6 @@ public class MachineCtrl 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) @@ -1088,21 +1075,7 @@ public class MachineCtrl 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())) + if(checkboxInstallGLUTFontSupport.equals(e.getItemSelectable())) { installGLUTFontSupport = checkboxInstallGLUTFontSupport.getState(); diff --git a/Installer/makeNetscapeSignedJar-Win32.sh b/Installer/makeNetscapeSignedJar-Win32.sh index ba67d38..bb86f85 100755 --- a/Installer/makeNetscapeSignedJar-Win32.sh +++ b/Installer/makeNetscapeSignedJar-Win32.sh @@ -23,11 +23,11 @@ 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 +signtool -d . -e .class -k GL4JInst205 -Z GL4JInst_ns.jar -c9 --norecurse . rm -rf META-INF -#rm -f key3.db cert7.db *.class +rm -f key3.db cert7.db *.class |