public static void RunUnpatch(GameUnpatchClass patch) { var progressForm = new ProgressForm(); patch.SetReporter(progressForm.GetProgressReporter()); var thread = new System.Threading.Thread(patch.Run); thread.Start(); progressForm.ShowDialog(); thread.Join(); var result = patch.Result; if (result.AllSuccessful) { MessageBox.Show( "Successfully removed all patches.\n\n" + "You can close SenPatcher now and just run the game as you normally would." ); return; } else { MessageBox.Show( "Failed removing " + result.FailedFiles + " of the selected " + result.TotalFiles + " patches.\n" + "Please ensure SenPatcher is allowed to write to the game directory, then try again.\n" + "It's also possible that the game data is corrupted or has been modified by other mods. " + "If so, try verifying game files on Steam or GoG, or reinstall the game. " + "Be sure to close and reopen SenPatcher before trying again in this case." ); } }
private void buttonUnpatch_Click(object sender, EventArgs e) { try { var mods = new List <FileMod>(); mods.AddRange(Sen1Mods.GetExecutableMods()); mods.AddRange(Sen1Mods.GetAssetMods()); GameUnpatchClass.RunUnpatch(new GameUnpatchClass(Path, Storage, mods)); } catch (Exception ex) { MessageBox.Show("Unknown error occurred: " + ex.Message); } }