public static void BuildManifest(string directory) { LauncherManifest manifest = new LauncherManifest(); md5 = MD5.Create(); RecursiveBuildManifest(directory, "", manifest); string ManifestPath = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar + ManifestName; File.WriteAllText(ManifestPath, JsonConvert.SerializeObject(manifest, Formatting.Indented)); }
private static void RecursiveBuildManifest(string projectRoot, string dir, LauncherManifest manifest) { string path = projectRoot + dir; foreach (string file in Directory.GetFiles(path)) { string localPath = ToLocalPath(projectRoot, file); string hash = ComputeMD5(file); if (!localPath.EndsWith("_.cfg") && localPath != "/ManifestBuilder.exe" && localPath != "/Manifest.txt" && localPath != "/Newtonsoft.Json.dll") //we don't want cfg files to get updated here cept config.cfg which is in ignore.list { manifest.Files[localPath] = hash; } } foreach (string nextDir in Directory.GetDirectories(path)) { RecursiveBuildManifest(projectRoot, ToLocalPath(projectRoot, nextDir), manifest); } }