private void RefreshInstalledMods() { CleanerHelper _cleanerHelper = new CleanerHelper(); InjectionHelper _injectionHelper = new InjectionHelper(); //copy pasted var installedModsList = _cleanerHelper.InstalledMods(gameFolderPathString); if (installedModsList.Count > 0) { _injectionHelper.RefreshInstalledMods(gameFolderPathString, installedModsList); Console.WriteLine("Mods Refreshed"); } }
private void InstallMods(List <string> modsToInstall, bool safeInstall = true) { CleanerHelper _cleanerHelper = new CleanerHelper(); InjectionHelper _injectionHelper = new InjectionHelper(); BackupHelper _backupHelper = new BackupHelper(); if (modsToInstall.Count > 0) { var installedModsList = _cleanerHelper.InstalledMods(gameFolderPathString); if (installedModsList == null) { _backupHelper.DoBackup(gameFolderPathString); } foreach (string installedMod in installedModsList) { if (modsToInstall.Contains(installedMod)) { Console.WriteLine("Warning: Tried to install an already installed mod"); if (safeInstall) { Console.WriteLine("Safe install is on, aborting. To turn it of, use the --unsafe-install option"); return; } else { modsToInstall.Remove(installedMod); Console.WriteLine("Continuing installation"); } } } if (_injectionHelper.InstallSelectedMods(gameFolderPathString, modsToInstall) == true) //If we successfully combined the mod files into the assembly { Console.WriteLine("Installation successfull"); } else { Console.WriteLine("Installation failed."); Console.WriteLine("Terminated modding attempt. Trying to scrub mod files."); if (_cleanerHelper.CleanGameFolder(gameFolderPathString) == true) { } } } }