private void UninstallAllMods()
        {
            CleanerHelper _cleanerHelper = new CleanerHelper();
            BackupHelper  _backupHelper  = new BackupHelper();

            //copy pasted
            if (_cleanerHelper.CheckModStatus(gameFolderPathString) == true)
            {
                var installedModsList = _cleanerHelper.InstalledMods(gameFolderPathString);
                if (installedModsList.Count > 0)
                {
                    _cleanerHelper.RemoveMods(gameFolderPathString, installedModsList);
                    _cleanerHelper.CleanGameFolder(gameFolderPathString);
                }

                try
                {
                    _cleanerHelper.RemoveMod(gameFolderPathString, "ModMenu");
                    _backupHelper.RestoreBackup(gameFolderPathString);
                    _backupHelper.DeleteBackup(gameFolderPathString);
                }
                catch { Console.WriteLine("Could not remove ModMenu. Please verify your files"); }
                Console.WriteLine("Uninstalled All mods");
            }
            else
            {
                Console.WriteLine("CheckModStatus failed");
                _cleanerHelper.CleanGameFolder(gameFolderPathString);
            }
        }
Example #2
0
        private void UninstallModsButton_Click(object sender, EventArgs e)
        {
            if (_cleanerHelper.CheckModStatus(gameFolderPathString) == true)
            {
                var installedModsList = _cleanerHelper.InstalledMods(gameFolderPathString);
                _cleanerHelper.RemoveMods(gameFolderPathString, installedModsList);
                InstalledModsDGV.Rows.Clear();
                GetAvailableModsAndAddThemToAvailbleModsList();
                _cleanerHelper.CleanGameFolder(gameFolderPathString);

                _cleanerHelper.RemoveMod(gameFolderPathString, "ModMenu");
                _backupHelper.RestoreBackup(gameFolderPathString);
                _backupHelper.DeleteBackup(gameFolderPathString);
            }
            else
            {
                _cleanerHelper.CleanGameFolder(gameFolderPathString);
            }
        }
Example #3
0
 private void UninstallModsButton_Click(object sender, EventArgs e)
 {
     if (_cleanerHelper.CheckModStatus(gameFolderPathString) == true)
     {
         var installedModsList = _cleanerHelper.InstalledMods(gameFolderPathString);
         if (installedModsList.Count > 0)
         {
             _cleanerHelper.RemoveMods(gameFolderPathString, installedModsList);
             InstalledModsDGV.Rows.Clear();
             GetAvailableModsAndAddThemToAvailbleModsList();
             _cleanerHelper.CleanGameFolder(gameFolderPathString);
         }
         try
         {
             _cleanerHelper.RemoveMod(gameFolderPathString, "ModMenu");
             _backupHelper.RestoreBackup(gameFolderPathString);
             _backupHelper.DeleteBackup(gameFolderPathString);
         } catch { Debug.WriteLine("Could not remove ModMenu. Please verify your files"); }
     }
     else
     {
         _cleanerHelper.CleanGameFolder(gameFolderPathString);
     }
 }