private static string GetComponentRoot(DirectoryTag DirTag, string Id)
 {
     var Cfg = GetMainConfig(DirTag);
     if (string.IsNullOrWhiteSpace(Cfg))
         throw new Exception("Broken backup. Main config file not found.");
     var XCfg = new XmlDocument();
     XCfg.Load(Cfg);
     var Component = XCfg.SelectSingleNode(string.Format("//component[.//add/@key='ComponentName' and .//add/@value='{0}']", Id));
     var InstallFolder = Component.SelectSingleNode(".//add[@key='InstallFolder']");
     return InstallFolder.Attributes["value"].Value;
 }
 private static string GetMainConfig(DirectoryTag DirTag)
 {
     return Path.Combine(DirTag.Name, ConfigDirectory, MainConfig);
 }