private void btnInstall_Click(object sender, EventArgs e) { btnInstall.Enabled = false; txtMC.Enabled = false; txtForge.Enabled = false; new Thread(() => { try { var forge = new MForge(Path, javapath); forge.FileChanged += Forge_FileChanged; forge.InstallerOutput += Forge_InstallerOutput; var versionName = forge.InstallForge(txtMC.Text, txtForge.Text); LastInstalledVersion = versionName; MessageBox.Show($"{versionName} was successfully installed"); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { Invoke(new Action(() => { btnInstall.Enabled = true; txtMC.Enabled = true; txtForge.Enabled = true; })); } }).Start(); }
public string CheckForge(string mcversion, string forgeversion) { if (ProfileInfos == null || ProfileInfos.Length == 0) { UpdateProfileInfos(); } var versionname = GetVersionNameByForge(mcversion, forgeversion); if (!ProfileInfos.Any(x => x.Name == versionname)) { var mforge = new MForge(Minecraft); mforge.FileChanged += (e) => fire(e); mforge.InstallForge(mcversion, forgeversion); UpdateProfileInfos(); } return(versionname); }