0) { Array.Resize(ref lines, lines.Length + 1); } lineIndex = lines.Length - 1; // End with new line Array.Resize(ref lines, lines.Length + 1); } lines[lineIndex] = newLine; File.WriteAllLines(checkFile, lines); } catch (Exception ex) { Log.LogWarningFromException(ex, showStackTrace: false); } } private int GetCheckFileLineIndexSha256(string[] lines, string name, out string sha256) { for (int i = 0; i < lines.Length; i++) { string line = lines[i]; string[] lineParts = line.Split('='); if (lineParts.Length == 2) { string lineTag = lineParts[0].Trim(); string lineSha256 = lineParts[1].Trim(); if (lineTag == name) { sha256 = lineSha256; return i; } } } sha256 = null; return -1; } private bool CheckFileSha256(string file, string expectedSha256, out string actualSha256) { using (var fs = new FileStream(file, FileMode.Open)) { var hasher = System.Security.Cryptography.SHA256.Create(); byte[] hash = hasher.ComputeHash(fs); actualSha256 = BytesToHexString(hash); if (String.Equals(actualSha256, expectedSha256, StringComparison.OrdinalIgnoreCase)) { return true; } } return false; } private string BytesToHexString(byte[] data) { var sb = new StringBuilder(); foreach (byte b in data) { sb.Append(b.ToString("x2")); } return sb.ToString(); } private static void ExtractZip(string zipPath, string destinationDirectory, bool overwrite) { var archive = ZipFile.OpenRead(zipPath); if (!overwrite) { archive.ExtractToDirectory(destinationDirectory); return; } foreach (ZipArchiveEntry file in archive.Entries) { string fileName = Path.Combine(destinationDirectory, file.FullName); string directory = Path.GetDirectoryName(fileName); if (!Directory.Exists(directory)) { Directory.CreateDirectory(directory); } if (file.Name != String.Empty) { file.ExtractToFile(fileName, true); } } } ]]> $(MsBuildThisFileDirectory) $(RootDir).dependencies https://github.com/OpenRCT2/Dependencies/releases/download/v38/openrct2-libs-v38-arm64-windows-static.zip 00ef08029e6eb251917a73a92063472dba92422ae91846cfa75d83bbdcdb3a4d https://github.com/OpenRCT2/Dependencies/releases/download/v38/openrct2-libs-v38-x64-windows-static.zip c9fdda3556305b4b9276d5901b37067b73eae80d95427189f026b78753e84f7b https://github.com/OpenRCT2/Dependencies/releases/download/v38/openrct2-libs-v38-x86-windows-static.zip dd58ad06d747caf2b6d34cfc90de217fb92379bde75183dbc91a25e191ec81fa https://github.com/OpenRCT2/title-sequences/releases/download/v0.4.14/title-sequences.zip 140df714e806fed411cc49763e7f16b0fcf2a487a57001d1e50fce8f9148a9f3 https://github.com/OpenRCT2/objects/releases/download/v1.7.3/objects.zip c81029264578706ed1db88665e12a70a583e71dc4d3eb4db262535d2f0589eab https://github.com/OpenRCT2/OpenSoundEffects/releases/download/v1.0.6/opensound.zip 06b90f3e19c216752df441d551b26a9e3e1ba7755bdd2102504b73bf993608be https://github.com/OpenRCT2/OpenMusic/releases/download/v1.6.1/openmusic.zip 994b350d3b180ee1cb9619fe27f7ebae3a1a5232840c4bd47a89f33fa89de1a1 https://github.com/OpenRCT2/replays/releases/download/v0.0.89/replays.zip 04607bb1f67a0f31d841ed70b38d65b8f7a9e19749e414ff74b8a434bc90b42a