home *** CD-ROM | disk | FTP | other *** search
- package netscape.softupdate;
-
- import java.text.MessageFormat;
-
- final class WinRegItem extends InstallObject {
- private WinReg reg;
- private int rootkey;
- private int command;
- private String subkey;
- private String name;
- private Object value;
-
- WinRegItem(WinReg var1, int var2, int var3, String var4, String var5, Object var6) throws SoftUpdateException {
- super(var1.softUpdate());
- this.reg = var1;
- this.command = var3;
- this.rootkey = var2;
- this.subkey = var4;
- this.name = var5;
- this.value = var6;
- }
-
- protected void Complete() throws SoftUpdateException {
- switch (this.command) {
- case 1:
- this.reg.finalCreateKey(this.rootkey, this.subkey, this.name);
- return;
- case 2:
- this.reg.finalDeleteKey(this.rootkey, this.subkey);
- return;
- case 3:
- this.reg.finalDeleteValue(this.rootkey, this.subkey, this.name);
- return;
- case 4:
- this.reg.finalSetValueString(this.rootkey, this.subkey, this.name, (String)this.value);
- return;
- case 5:
- this.reg.finalSetValue(this.rootkey, this.subkey, this.name, (WinRegValue)this.value);
- return;
- default:
- throw new SoftUpdateException("WinRegItem", -208);
- }
- }
-
- float GetInstallOrder() {
- return 3.0F;
- }
-
- public String toString() {
- switch (this.command) {
- case 1:
- Object[] var5 = new Object[]{this.keystr(this.rootkey, this.subkey, (String)null)};
- return MessageFormat.format(Strings.getString("winreg.addkey"), var5);
- case 2:
- Object[] var4 = new Object[]{this.keystr(this.rootkey, this.subkey, (String)null)};
- return MessageFormat.format(Strings.getString("winreg.delkey"), var4);
- case 3:
- Object[] var3 = new Object[]{this.keystr(this.rootkey, this.subkey, this.name)};
- return MessageFormat.format(Strings.getString("winreg.delval"), var3);
- case 4:
- Object[] var2 = new Object[]{this.keystr(this.rootkey, this.subkey, this.name)};
- return MessageFormat.format(Strings.getString("winreg.storeval"), var2);
- case 5:
- Object[] var1 = new Object[]{this.keystr(this.rootkey, this.subkey, this.name)};
- return MessageFormat.format(Strings.getString("winreg.storeval"), var1);
- default:
- return "?WinReg? " + this.keystr(this.rootkey, this.subkey, this.name);
- }
- }
-
- private String keystr(int var1, String var2, String var3) {
- String var4;
- switch (var1) {
- case Integer.MIN_VALUE:
- var4 = "\\HKEY_CLASSES_ROOT\\";
- break;
- case -2147483647:
- var4 = "\\HKEY_CURRENT_USER\\";
- break;
- case -2147483646:
- var4 = "\\HKEY_LOCAL_MACHINE\\";
- break;
- case -2147483645:
- var4 = "\\HKEY_USERS\\";
- break;
- default:
- var4 = "\\#" + var1 + "\\";
- }
-
- return var3 == null ? var4 + var2 : var4 + var2 + " [" + var3 + "]";
- }
-
- protected void Abort() {
- }
-
- protected void Prepare() throws SoftUpdateException {
- }
-
- protected boolean CanUninstall() {
- return false;
- }
-
- protected boolean RegisterPackageNode() {
- return true;
- }
- }
-