protected virtual DetectedLocations getPaths(LocationPath get_me) { DetectedLocations return_me = new DetectedLocations(); if (!ready) { return(return_me); } foreach (UserData user in this) { if (!user.hasFolderFor(get_me.EV)) { continue; } EvFolder evf = user.getFolder(get_me.EV); foreach (DetectedLocationPathHolder add_me in evf.createDetectedLocations(get_me, user.name)) { if (add_me.Exists) { return_me.Add(add_me); } } } if (global.hasFolderFor(get_me.EV)) { foreach (DetectedLocationPathHolder add_me in global.getFolder(get_me.EV).createDetectedLocations(get_me, null)) { if (add_me.Exists) { return_me.Add(add_me); } } } return(return_me); }
protected override DetectedLocations getPaths(ScummVM get_me) { if (get_me.Name == "scummvm") { Console.Out.Write(""); } List <DetectedLocationPathHolder> paths = new List <DetectedLocationPathHolder>(); if (Locations == null) { setup(); } if (install_path != null) { paths.AddRange(loadLocations(install_path, get_me, null)); } DetectedLocations return_me = new DetectedLocations(); foreach (string user in Locations.Keys) { if (get_me.Name != "scummvm" && Locations[user].ContainsKey("scummvm")) { foreach (DetectedLocationPathHolder path in loadLocations(Locations[user]["scummvm"], get_me, user)) { DirectoryInfo info = new DirectoryInfo(path.FullDirPath); if (info.GetFiles(get_me.Name + "*").Length > 0) { return_me.Add(path); } } } if (Locations[user].ContainsKey(get_me.Name)) { return_me.AddRange(loadLocations(Locations[user][get_me.Name], get_me, user)); } } return(return_me); }
protected override DetectedLocations getPaths(LocationPath get_me) { DetectedLocations return_me = new DetectedLocations(); DirectoryInfo test; DetectedLocationPathHolder add_me; switch (get_me.EV) { case EnvironmentVariable.InstallLocation: LocationPath temp = new LocationPath(get_me); string[] chopped = temp.Path.Split(Path.DirectorySeparatorChar); for (int i = 0; i < chopped.Length; i++) { temp.ReplacePath(chopped[i]); for (int j = i + 1; j < chopped.Length; j++) { temp.AppendPath(chopped[j]); } temp.EV = EnvironmentVariable.Drive; return_me.AddRange(getPaths(temp)); temp.EV = EnvironmentVariable.AltSavePaths; return_me.AddRange(getPaths(temp)); } break; case EnvironmentVariable.AltSavePaths: foreach (AltPathHolder alt_path in Core.settings.save_paths) { if (PermissionsHelper.isReadable(alt_path.path)) { if (get_me.Path != null && get_me.Path.Length > 0) { test = new DirectoryInfo(Path.Combine(alt_path.path, get_me.Path)); } else { test = new DirectoryInfo(alt_path.path); } if (test.Exists) { DetectedLocations locs = Core.locations.interpretPath(test.FullName); foreach (DetectedLocationPathHolder loc in locs) { return_me.Add(loc); } } } } break; case EnvironmentVariable.Drive: foreach (string drive in drives) { if (get_me.Path != null && get_me.Path.Length > 0) { test = new DirectoryInfo(Path.Combine(drive, get_me.Path)); } else { test = new DirectoryInfo(drive); } if (test.Exists) { add_me = new DetectedLocationPathHolder(get_me, drive, null); return_me.Add(add_me); } } break; default: return(base.getPaths(get_me)); } return(return_me); }
protected override DetectedLocations getPaths(LocationPath get_me) { //if(get_me.rel_root!= EnvironmentVariable.Public) // return new List<DetectedLocationPathHolder>(); DetectedLocations return_me = new DetectedLocations(); DetectedLocationPathHolder add_me; DirectoryInfo test; switch (get_me.EV) { case EnvironmentVariable.InstallLocation: LocationPath temp = new LocationPath(get_me); string[] chopped = temp.Path.Split(Path.DirectorySeparatorChar); for (int i = 0; i < chopped.Length; i++) { temp.ReplacePath(chopped[i]); for (int j = i + 1; j < chopped.Length; j++) { temp.AppendPath(chopped[j]); } temp.EV = EnvironmentVariable.ProgramFiles; return_me.AddRange(getPaths(temp)); } return_me.AddRange(base.getPaths(get_me)); break; case EnvironmentVariable.ProgramFiles: case EnvironmentVariable.ProgramFilesX86: // Always checks both the VirtualStore and the real Program Files, // to make sure nothing is missed, especially in the case of old games // that may or may not use the VirtualStore if (!get_me.override_virtual_store && platform_version == "WindowsVista") { LocationPath virtualstore_info = new LocationPath(get_me); virtualstore_info.EV = EnvironmentVariable.LocalAppData; if (x64) { virtualstore_info.ReplacePath(Path.Combine("VirtualStore", global.getFolder(EnvironmentVariable.ProgramFilesX86).BaseFolder.Substring(3), virtualstore_info.Path)); return_me.AddRange(getPaths(virtualstore_info)); virtualstore_info = new LocationPath(get_me); virtualstore_info.EV = EnvironmentVariable.LocalAppData; } virtualstore_info.ReplacePath(Path.Combine("VirtualStore", global.getFolder(EnvironmentVariable.ProgramFiles).BaseFolder.Substring(3), virtualstore_info.Path)); return_me.AddRange(getPaths(virtualstore_info)); } if (x64) { if (get_me.Path != null && get_me.Path.Length > 0) { test = new DirectoryInfo(Path.Combine(global.getFolder(EnvironmentVariable.ProgramFilesX86).BaseFolder, get_me.Path)); } else { test = new DirectoryInfo(global.getFolder(EnvironmentVariable.ProgramFilesX86).BaseFolder); } if (test.Exists) { add_me = new DetectedLocationPathHolder(get_me, global.getFolder(EnvironmentVariable.ProgramFilesX86).BaseFolder, null); return_me.Add(add_me); } } if (get_me.Path != null && get_me.Path.Length > 0) { test = new DirectoryInfo(Path.Combine(global.getFolder(EnvironmentVariable.ProgramFiles).BaseFolder, get_me.Path)); } else { test = new DirectoryInfo(global.getFolder(EnvironmentVariable.ProgramFiles).BaseFolder); } if (test.Exists) { add_me = new DetectedLocationPathHolder(get_me, global.getFolder(EnvironmentVariable.ProgramFiles).BaseFolder, null); return_me.Add(add_me); } break; default: return(base.getPaths(get_me)); } return(return_me); }