private static void Install_Legacy_01(string dirpath) { SetDisplayText("Downloading CumLoader..."); string tempfilepath = TempFileCache.CreateFile(); webClient.DownloadFileAsync(new Uri("https://github.com/Goatxz/CumLoader/releases/download/v0.1.0/CumLoader.zip"), tempfilepath); while (webClient.IsBusy) { } SetDisplayText("Downloading Dependencies..."); string tempfilepath2 = TempFileCache.CreateFile(); webClient.DownloadFileAsync(new Uri("https://github.com/Goatxz/CumLoader/releases/download/v0.1.0/MonoDependencies.zip"), tempfilepath2); while (webClient.IsBusy) { } SetDisplayText("Extracting CumLoader..."); Cleanup(dirpath); ExtractZip(dirpath, tempfilepath); SetDisplayText("Extracting Dependencies..."); ExtractZip(dirpath, tempfilepath2); CreateDirectories(dirpath, "v0.1.0", true); }
private static void Install_Silent(string dirpath, string selectedVersion) { string tempfilepath = TempFileCache.CreateFile(); webClient.DownloadFileAsync(new Uri("https://github.com/Goatxz/CumLoader/releases/download/" + selectedVersion + "/CumLoader.zip"), tempfilepath); while (webClient.IsBusy) { } Cleanup(dirpath); ExtractZip(dirpath, tempfilepath); CreateDirectories(dirpath, selectedVersion, false); }
private static void Install_Legacy_02(string dirpath, string selectedVersion) { SetDisplayText("Downloading CumLoader..."); bool is_02 = selectedVersion.Equals("v0.2"); string tempfilepath = TempFileCache.CreateFile(); webClient.DownloadFileAsync(new Uri("https://github.com/Goatxz/CumLoader/releases/download/" + selectedVersion + "/CumLoader" + (is_02 ? "_" : ".") + (File.Exists(Path.Combine(dirpath, "GameAssembly.dll")) ? "Il2Cpp" : "Mono") + ".zip"), tempfilepath); while (webClient.IsBusy) { } SetDisplayText("Extracting CumLoader..."); Cleanup(dirpath); ExtractZip(dirpath, tempfilepath); if (is_02) { string AssemblyGenerator_Folder = Path.Combine(Path.Combine(dirpath, "CumLoader"), "AssemblyGenerator"); string Il2CppDumper_Folder = Path.Combine(AssemblyGenerator_Folder, "Il2CppDumper"); string Il2CppAssemblyUnhollower_Folder = Path.Combine(AssemblyGenerator_Folder, "Il2CppAssemblyUnhollower"); string UnityDependencies_Folder = Path.Combine(Il2CppAssemblyUnhollower_Folder, "UnityDependencies"); SetDisplayText("Downloading Il2CppDumper..."); string tempfilepath2 = TempFileCache.CreateFile(); webClient.DownloadFileAsync(new Uri("https://github.com/Perfare/Il2CppDumper/releases/download/v6.2.1/Il2CppDumper-v6.2.1.zip"), tempfilepath2); while (webClient.IsBusy) { } SetDisplayText("Downloading Il2CppUnhollower..."); string tempfilepath3 = TempFileCache.CreateFile(); webClient.DownloadFileAsync(new Uri("https://github.com/knah/Il2CppAssemblyUnhollower/releases/download/v0.4.3.0/Il2CppAssemblyUnhollower.0.4.3.0.zip"), tempfilepath3); while (webClient.IsBusy) { } SetDisplayText("Downloading Dependencies..."); string tempfilepath4 = TempFileCache.CreateFile(); bool run_fallback = false; try { webClient.DownloadFileAsync(new Uri("https://github.com/Goatxz/CumLoader/raw/master/BaseLibs/UnityDependencies/" + mainForm.UnityVersion + ".zip"), tempfilepath4); while (webClient.IsBusy) { } } catch (Exception ex) { run_fallback = true; } if (run_fallback) { string subver = mainForm.UnityVersion.Substring(0, mainForm.UnityVersion.LastIndexOf(".")); JsonArray data = (JsonArray)JsonValue.Parse(Program.webClient.DownloadString("https://api.github.com/repos/Goatxz/CumLoader/contents/BaseLibs/UnityDependencies")).AsJsonArray; if (data.Count > 0) { List <string> versionlist = new List <string>(); foreach (var x in data) { string version = Path.GetFileNameWithoutExtension(x["name"].AsString); if (version.StartsWith(subver)) { versionlist.Add(version); } } if (versionlist.Count > 0) { versionlist = versionlist.OrderBy(x => int.Parse(x.Split(new char[] { '.' })[2])).ToList(); string latest_version = versionlist.Last(); webClient.DownloadFileAsync(new Uri("https://github.com/Goatxz/CumLoader/raw/master/BaseLibs/UnityDependencies/" + latest_version + ".zip"), tempfilepath4); while (webClient.IsBusy) { } } } } SetDisplayText("Extracting Il2CppDumper..."); ExtractZip(Il2CppDumper_Folder, tempfilepath2); SetDisplayText("Extracting Il2CppUnhollower..."); ExtractZip(Il2CppAssemblyUnhollower_Folder, tempfilepath3); SetDisplayText("Extracting Dependencies..."); ExtractZip(UnityDependencies_Folder, tempfilepath4); } CreateDirectories(dirpath, selectedVersion, true); }