public async void EditLocation(string desPath, ManifestInfo manifest) { string target = manifest.InstallLocation; //ManifestLocation, InstallLocation, and StagingLocation foreach (ManifestInfo manifestInfo in Manifests) { if (manifestInfo == manifest) { manifestInfo.ManifestLocation = manifestInfo.ManifestLocation.Replace(target, desPath); manifestInfo.InstallLocation = manifestInfo.InstallLocation.Replace(target, desPath); manifestInfo.StagingLocation = manifestInfo.StagingLocation.Replace(target, desPath); Lancher.InstallationList.Find(i => i.AppName == manifestInfo.AppName).InstallLocation = desPath; } } }
public GamesInfo() { Manifests = new List <ManifestInfo>(); string path = @"C:\ProgramData\Epic\EpicGamesLauncher\Data\Manifests"; if (Directory.Exists(path)) { DirectoryInfo directory = new DirectoryInfo(path); foreach (FileInfo file in directory.GetFiles()) { ManifestInfo myDeserializedClass = JsonConvert.DeserializeObject <ManifestInfo>(File.ReadAllText(file.FullName)); Manifests.Add(myDeserializedClass); } } path = @"C:\ProgramData\Epic\UnrealEngineLauncher\LauncherInstalled.dat"; Lancher = JsonConvert.DeserializeObject <InstallationLancher>(File.ReadAllText(path)); }