home *** CD-ROM | disk | FTP | other *** search
- package netscape.softupdate;
-
- 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:
- return "Create Registry Key " + this.keystr(this.rootkey, this.subkey, (String)null);
- case 2:
- return "Delete Registry key " + this.keystr(this.rootkey, this.subkey, (String)null);
- case 3:
- return "Delete Registry value " + this.keystr(this.rootkey, this.subkey, this.name);
- case 4:
- return "Store Registry value " + this.keystr(this.rootkey, this.subkey, this.name);
- case 5:
- return "Store Registry value " + this.keystr(this.rootkey, this.subkey, this.name);
- default:
- return "Unknown " + 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 + "]";
- }
- }
-