home *** CD-ROM | disk | FTP | other *** search
- package netscape.softupdate;
-
- import java.text.MessageFormat;
- import netscape.security.AppletSecurity;
- import netscape.security.PrivilegeManager;
- import netscape.security.Target;
-
- class UninstallObject extends InstallObject {
- private String regName;
- private String userName;
-
- UninstallObject(SoftwareUpdate var1, String var2) throws SoftUpdateException {
- super(var1);
- this.regName = var2;
- if (this.regName != null && this.regName.length() != 0) {
- PrivilegeManager var3 = AppletSecurity.getPrivilegeManager();
- Target var4 = Target.findTarget("Impersonator");
- var3.enablePrivilege(var4);
- Target var5 = Target.findTarget("SoftwareInstall");
- var3.enablePrivilege(var5, super.softUpdate.GetPrincipal());
- this.userName = VersionRegistry.getUninstallUserName(this.regName);
- if (this.userName == null) {
- throw new SoftUpdateException("", -213);
- }
- } else {
- throw new SoftUpdateException("", -208);
- }
- }
-
- protected void Complete() throws SoftUpdateException {
- PrivilegeManager var3 = AppletSecurity.getPrivilegeManager();
- Target var4 = Target.findTarget("Impersonator");
- var3.enablePrivilege(var4);
- Target var2 = Target.findTarget("SoftwareInstall");
- var3.enablePrivilege(var2, super.softUpdate.GetPrincipal());
- int var1 = this.NativeComplete(this.regName);
- var3.revertPrivilege(var2);
- if (var1 != 0) {
- var1 = -223;
- throw new SoftUpdateException(Strings.error_Unexpected() + this.regName, var1);
- }
- }
-
- protected void Prepare() throws SoftUpdateException {
- }
-
- protected void Abort() {
- }
-
- private native int NativeComplete(String var1) throws SoftUpdateException;
-
- public String toString() {
- Object[] var1 = new Object[]{this.userName};
- return MessageFormat.format(Strings.details_Uninstall(), var1);
- }
-
- protected boolean CanUninstall() {
- return false;
- }
-
- protected boolean RegisterPackageNode() {
- return false;
- }
- }
-