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/v41/openrct2-libs-v41-arm64-windows-static.zip 5d171f23eee584bdc29b1186dc7a86d935a6ea58efa42b5674c196c5b581923b https://github.com/OpenRCT2/Dependencies/releases/download/v41/openrct2-libs-v41-x64-windows-static.zip 8e78f1c3c09c50cb0f509eab6845a93dd69771ff95cdf82d747568093d138f73 https://github.com/OpenRCT2/Dependencies/releases/download/v41/openrct2-libs-v41-x86-windows-static.zip 490263b873dd02c13a043a04d26bb9837d2d378dacd8b2c8d29660fef44db3db https://github.com/OpenRCT2/title-sequences/releases/download/v0.4.26/title-sequences.zip dabb9787b1576342fca4dd9f64b3f8cfa04a7e6ce9c2bb9610f47b762905c858 https://github.com/OpenRCT2/objects/releases/download/v1.7.5/objects.zip c8b9d3039a920f67caf15b09e8312cc4f80d59ed7fe0288625b9ccedef606797 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.90/replays.zip f8474a927e155056e5729b6fa9f05af2a85ae7e1435f5fa89ba496242f9f255e