Beispiel #1
0
        private void c_btnReinstallAddon_Click(object sender, EventArgs e)
        {
            string addonName = (string)c_lbAddons.SelectedItem;

            if (Utility.MessageBoxShow("Reinstalling an addon means all the previous WTF/savedvariables data will be removed. Are you sure you want to reinstall the addon \"" + addonName + "\"?", "Are you sure?", MessageBoxButtons.YesNoCancel) == System.Windows.Forms.DialogResult.Yes)
            {
                string backupFile = InstalledAddons.BackupAddon(addonName, WowVersionEnum.Vanilla, AddonBackupMode.BackupWTF);
                InstalledAddons.ReinstallAddon(addonName, WowVersionEnum.Vanilla);
                Utility.MessageBoxShow("Addon \"" + addonName + "\" was successfully reinstalled!\r\n\r\nA backup zip file of the old WTF files was saved incase you regret the decision:\r\n" + StaticValues.LauncherWorkDirectory + "\\" + backupFile);
            }
        }
Beispiel #2
0
        private void c_btnUninstallAddon_Click(object sender, EventArgs e)
        {
            string addonName = (string)c_lbAddons.SelectedItem;

            c_btnUninstallAddon.Enabled = false;
            if (c_lbNeededFor.Items.Count == 0)
            {
                if (Utility.MessageBoxShow("Are you sure you want to uninstall the addon \"" + addonName + "\"?", "Are you sure?", MessageBoxButtons.YesNoCancel) == System.Windows.Forms.DialogResult.Yes)
                {
                    string backupFile = InstalledAddons.BackupAddon(addonName, WowVersionEnum.Vanilla);
                    if (InstalledAddons.UninstallAddon(addonName, WowVersionEnum.Vanilla) == true)
                    {
                        Utility.MessageBoxShow("Addon \"" + addonName + "\" was successfully uninstalled!\r\n\r\nA backup zip file of the addon and WTF files was saved incase you regret the decision here:\r\n" + StaticValues.LauncherWorkDirectory + "\\" + backupFile);
                        c_lbAddons.SelectedIndex = 0;
                        c_lbAddons.Items.Remove(addonName);
                    }
                    else
                    {
                        Utility.MessageBoxShow("Addon \"" + addonName + "\" could not be uninstalled. Try again later. If you get this error all the times contact Dilatazu for more info.");
                    }
                }
            }
            else
            {
                string neededForStr = "";
                foreach (string item in c_lbNeededFor.Items)
                {
                    neededForStr = neededForStr + item + "\r\n";
                }
                if (Utility.MessageBoxShow("\"" + addonName + "\" is needed for multiple addons. Removing this addon means that the following addons will stop work:\r\n" + neededForStr + "\r\nAre you sure you want to uninstall the addon?", "Are you sure?", MessageBoxButtons.YesNoCancel) == System.Windows.Forms.DialogResult.Yes)
                {
                    string backupFile = InstalledAddons.BackupAddon(addonName, WowVersionEnum.Vanilla);
                    if (InstalledAddons.UninstallAddon(addonName, WowVersionEnum.Vanilla) == true)
                    {
                        Utility.MessageBoxShow("Addon \"" + addonName + "\" was successfully uninstalled!\r\n\r\nA backup zip file of the addon and WTF files was saved incase you regret the decision:\r\n" + StaticValues.LauncherWorkDirectory + "\\" + backupFile);
                        c_lbAddons.SelectedIndex = 0;
                        c_lbAddons.Items.Remove(addonName);
                    }
                    else
                    {
                        Utility.MessageBoxShow("Addon \"" + addonName + "\" could not be uninstalled. Try again later. If you get this error all the times contact Dilatazu for more info.");
                    }
                }
            }
            c_btnUninstallAddon.Enabled = true;
        }