Exemple #1
0
        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();
        }
Exemple #2
0
        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);
        }