Exemplo n.º 1
0
        private void InstallMod()
        {
            if (modInstallDialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    if (modHelper.IsInstalled(tfDirectory, modInstallDialog.FileName))
                    {
                        if (MessageBox.Show("This mod already exists! Do you want to update it?", "Update Mod", MessageBoxButtons.YesNoCancel) == DialogResult.Yes)
                        {
                            modHelper.UpdateMod(tfDirectory, modInstallDialog.FileName);
                        }
                        else
                        {
                            modHelper.InstallMod(tfDirectory, modInstallDialog.FileName);
                        }
                    }
                    else
                    {
                        modHelper.InstallMod(tfDirectory, modInstallDialog.FileName);
                    }

                    ReloadModlist();
                    SetStatus("Mod installed succesfully");
                } catch (Exception ex)
                {
                    MessageBox.Show("The mod couldn't be installed!\n" + ex.Message);
                    return;
                }
            }
        }