Esempio n. 1
0
        /// <summary>
        /// This method takes the script returned by and CreateRgsScript and executes it in “uninstall” mode.
        /// </summary>
        public void Unregister(string rgsScript, NameValueCollection args)
        {
            RgsParser p    = new RgsParser();
            Key       root = p.Parse(rgsScript, args);

            foreach (Key key in root.children.Values)
            {
                if (key.Name == "HKCR")
                {
                    Unregister(key, Registry.ClassesRoot);
                }
                else if (key.Name == "HKLM")
                {
                    Unregister(key, Registry.LocalMachine);
                }
                else if (key.Name == "HKCU")
                {
                    Unregister(key, Registry.CurrentUser);
                }
                else
                {
                    Error("Root keys must be 'HKCR', 'HKLM' or 'HKCU'");
                }
            }
        }
Esempio n. 2
0
 /// <summary>
 /// This method takes the script returned by and CreateRgsScript and executes it in “uninstall” mode. 
 /// </summary>
 public void Unregister(string rgsScript, NameValueCollection args) {
   RgsParser p = new RgsParser();
   Key root = p.Parse(rgsScript, args);
   foreach (Key key in root.children.Values) {
     if (key.Name == "HKCR") {
       Unregister(key, Registry.ClassesRoot);
     } else if (key.Name == "HKLM") {
       Unregister(key, Registry.LocalMachine);
     } else if (key.Name == "HKCU") {
       Unregister(key, Registry.CurrentUser);
     } else {
       Error("Root keys must be 'HKCR', 'HKLM' or 'HKCU'");
     }
   }    
 }