home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2001 December / dppcpro1201.iso / Extras / maple / Viewer / WebEQ / MMLViewerInstall.jar / mapleinst.js next >
Encoding:
JavaScript  |  2001-05-15  |  1.1 KB  |  42 lines

  1. //Conditional Alert
  2. function cAlert (message) {
  3.   if (!this.silent) {
  4.      alert(message);
  5.   }
  6. }
  7.  
  8. //Make sure Java is enabled
  9. if ( navigator.javaEnabled() ) {
  10.   
  11.   // Create a version oject and a software update object
  12.   vi = new netscape.softupdate.VersionInfo(1, 0, 1, 3);
  13.   su = new netscape.softupdate.SoftwareUpdate(this, "MathML Viewer 1.1");
  14.  
  15.   // Start the installation process
  16.   err = su.StartInstall("java/download/WMI/", vi,
  17.       netscape.softupdate.SoftwareUpdate.LIMITED_INSTALL);
  18.  
  19.   if (err == 0) {
  20.  
  21.     // Find the Java download directory on the user's machine
  22.     JavaFolder = su.GetFolder("Java Download");
  23.     
  24.     // Install the JAR archive.  Unpack it and list were it goes
  25.     err = su.AddSubcomponent("MathML Viewer 1.1", vi, "MMLViewerApplet.jar",
  26.        JavaFolder, "", this.force);
  27.   }
  28.  
  29.   // Unless there was a problem, move the JAR archive to final location
  30.   // and update the Client version registry
  31.   if (err !=0) {
  32.     su.AbortInstall();
  33.     cAlert(err);
  34.   }
  35.   else {
  36.     su.FinalizeInstall();
  37.     cAlert("Installation complete. Restart Communicator");
  38.   }
  39. }
  40.  
  41.  
  42.