Пример #1
0
        private void UpdateSystemConfiguration(string componentId)
        {
            try
            {
                Log.WriteStart("Updating system configuration");
                string componentName = AppConfig.GetComponentSettingStringValue(componentId, "ComponentName");
                Log.WriteInfo(string.Format("Deleting \"{0}\" component settings ", componentName));
                XmlUtils.RemoveXmlNode(AppConfig.GetComponentConfig(componentId));
                Log.WriteInfo("Saving system configuration");
                AppConfig.SaveConfiguration();
                Log.WriteEnd("Updated system configuration");
                InstallLog.AppendLine("- Updated system configuration");
            }
            catch (Exception ex)
            {
                if (Utils.IsThreadAbortException(ex))
                {
                    return;
                }

                Log.WriteError("Config error", ex);
                InstallLog.AppendLine("- Failed to update system configuration");
                throw;
            }
        }
Пример #2
0
 private static void DeleteComponentSettings(string id, string name)
 {
     try
     {
         Log.WriteStart("Deleting component settings");
         Log.WriteInfo(string.Format("Deleting \"{0}\" settings", name));
         XmlNode node = AppConfig.GetComponentConfig(id);
         if (node != null)
         {
             XmlUtils.RemoveXmlNode(node);
             AppConfig.SaveConfiguration();
         }
         Log.WriteEnd("Deleted component settings");
     }
     catch (Exception ex)
     {
         if (Utils.IsThreadAbortException(ex))
         {
             return;
         }
         Log.WriteError("Component settings delete error", ex);
         throw;
     }
 }