private void LoadPlatformFromPath8(string folder, string subfolder, string platformTypeStr, int platformType) { if (Directory.Exists(folder + subfolder)) { if (Directory.Exists(folder + subfolder + @"\common")) { platformInfo platform = GetPlatform(platformType); if (platform == null) { platform = AddPlatform(platformType, folder + subfolder + @"\common\1cestart.exe"); } if (platform != null) { Regex RegExp = new Regex(@".*\\(?<version>(" + platformTypeStr + @"[.\d]*))$"); foreach (string childFolder in Directory.GetDirectories(folder + subfolder)) { MatchCollection Matches = RegExp.Matches(childFolder); if (Matches.Count > 0) { string stringVersion = Matches[0].Groups["version"].Value; if (platform.versions.GetVersion(stringVersion) == null) { platform.AddPlatformVersion(stringVersion, childFolder + @"\bin\"); } } } RegExp = null; } } else { platformInfo platform = GetPlatform(platformType); if (platform == null) { AddPlatform(platformType, folder + subfolder + @"\bin\1cv8.exe"); } } } }
private void LoadPlatformFromRegister(List <string> v8Folders, int platformType, string starterName, string commonTemplate, string binTemplate) { // 8.x common Regex RegExp = new Regex(commonTemplate); string path = null; foreach (string KeyValue in v8Folders) { path = KeyValue; if (RegExp.IsMatch(KeyValue)) { platformInfo platform = GetPlatform(platformType); if (!path.EndsWith(@"\")) { path += @"\"; } if (platform == null) { AddPlatform(platformType, path + starterName); } else { platform.starter = path + starterName; } } } if (!String.IsNullOrEmpty(binTemplate)) { // 8.x bin RegExp = new Regex(binTemplate); foreach (string KeyValue in v8Folders) { path = KeyValue; MatchCollection Matches = RegExp.Matches(KeyValue); if (Matches.Count > 0) { if (!path.EndsWith(@"\")) { path += @"\"; } platformInfo platform = GetPlatform(platformType); if (platform != null) { string stringVersion = Matches[0].Groups["version"].Value; if (platform.versions.GetVersion(stringVersion) == null) { platform.AddPlatformVersion(stringVersion, path); } } } } } RegExp = null; }