home *** CD-ROM | disk | FTP | other *** search
/ Popular Software (Pearl Edition) / 98CD05.iso / NET / NETSCAP4.50 / CP32E45.EXE / comm.z / java40.jar / netscape / softupdate / InstallExecute.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-07-13  |  2.3 KB  |  60 lines

  1. package netscape.softupdate;
  2.  
  3. import netscape.security.AppletSecurity;
  4. import netscape.security.PrivilegeManager;
  5. import netscape.security.Target;
  6.  
  7. class InstallExecute extends InstallObject {
  8.    private String jarLocation;
  9.    private String tempFile;
  10.    private String args;
  11.    private String cmdline;
  12.  
  13.    InstallExecute(SoftwareUpdate var1, String var2, String var3) {
  14.       super(var1);
  15.       this.jarLocation = var2;
  16.       this.args = var3;
  17.       PrivilegeManager var4 = AppletSecurity.getPrivilegeManager();
  18.       Target var5 = Target.findTarget("Impersonator");
  19.       var4.enablePrivilege(var5);
  20.       Target var6 = Target.findTarget("SoftwareInstall");
  21.       var4.enablePrivilege(var6, super.softUpdate.GetPrincipal());
  22.    }
  23.  
  24.    protected void Prepare() throws SoftUpdateException {
  25.       PrivilegeManager var1 = AppletSecurity.getPrivilegeManager();
  26.       Target var2 = Target.findTarget("Impersonator");
  27.       Target var3 = Target.findTarget("SoftwareInstall");
  28.       var1.enablePrivilege(var2);
  29.       var1.enablePrivilege(var3, super.softUpdate.GetPrincipal());
  30.       this.tempFile = super.softUpdate.ExtractJARFile(this.jarLocation, (String)null);
  31.       if (this.args != null && !System.getProperty("os.name").startsWith("Mac")) {
  32.          this.cmdline = this.tempFile + " " + this.args;
  33.       } else {
  34.          this.cmdline = this.tempFile;
  35.       }
  36.    }
  37.  
  38.    protected void Complete() throws SoftUpdateException {
  39.       PrivilegeManager var2 = AppletSecurity.getPrivilegeManager();
  40.       Target var3 = Target.findTarget("Impersonator");
  41.       var2.enablePrivilege(var3);
  42.       Target var1 = Target.findTarget("SoftwareInstall");
  43.       var2.enablePrivilege(var1, super.softUpdate.GetPrincipal());
  44.       this.NativeComplete();
  45.       var2.revertPrivilege(var1);
  46.    }
  47.  
  48.    protected void Abort() {
  49.       this.NativeAbort();
  50.    }
  51.  
  52.    private native void NativeComplete() throws SoftUpdateException;
  53.  
  54.    private native void NativeAbort();
  55.  
  56.    public String toString() {
  57.       return Strings.details_ExecuteProgress() + this.tempFile;
  58.    }
  59. }
  60.