From fc3feb997e601243109751753f24aa957b5988fc Mon Sep 17 00:00:00 2001 From: Rosalie Wanders Date: Sat, 31 Jan 2026 22:13:42 +0100 Subject: [PATCH 1/7] ModAPI.Common: add Version to ModConfiguration --- ModAPI.Common/InstalledMods.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ModAPI.Common/InstalledMods.cs b/ModAPI.Common/InstalledMods.cs index 516c0be..d82c1a6 100644 --- a/ModAPI.Common/InstalledMods.cs +++ b/ModAPI.Common/InstalledMods.cs @@ -52,6 +52,7 @@ public class ModConfiguration : IEquatable public string Name; public string Unique; + public Version Version; public string DisplayName; public string ConfiguratorPath; public List InstalledFiles = new List(); @@ -98,6 +99,13 @@ public void Save(XmlDocument document, XmlElement parent) element.Attributes.Append(uniqueAttribute); //} + if (Version != null) + { + var versionAttribute = document.CreateAttribute("version"); + versionAttribute.Value = Version.ToString(); + element.Attributes.Append(versionAttribute); + } + if (this.ConfiguratorPath != null) { attribute = document.CreateAttribute("configurator"); @@ -132,6 +140,17 @@ public void Load(XmlNode node) else Unique = nameAttribute.Value; + var versionAttribute = node.Attributes.GetNamedItem("version"); + if (versionAttribute != null && + Version.TryParse(versionAttribute.Value, out Version parsedVersion)) + { + Version = parsedVersion; + } + else + { + Version = null; + } + var displayNameAttribute = node.Attributes.GetNamedItem("displayName"); if (displayNameAttribute != null) this.DisplayName = displayNameAttribute.Value; From c6b4d938dd558184ce355e82392058b76acb27a9 Mon Sep 17 00:00:00 2001 From: Rosalie Wanders Date: Sat, 31 Jan 2026 22:14:13 +0100 Subject: [PATCH 2/7] Spore ModAPI Easy Installer: parse version attribute --- .../XmlInstallerWindow.xaml.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Spore ModAPI Easy Installer/XmlInstallerWindow.xaml.cs b/Spore ModAPI Easy Installer/XmlInstallerWindow.xaml.cs index 53d61da..0616e97 100644 --- a/Spore ModAPI Easy Installer/XmlInstallerWindow.xaml.cs +++ b/Spore ModAPI Easy Installer/XmlInstallerWindow.xaml.cs @@ -37,6 +37,7 @@ public partial class XmlInstallerWindow : DecoratableWindow string ModSettingsStoragePath = string.Empty; string ModConfigPath = string.Empty; string ModUnique = string.Empty; + Version ModVersion = null; XmlDocument Document = new XmlDocument(); List Prerequisites = new List(); List CompatFiles = new List(); @@ -243,6 +244,16 @@ private void PrepareInstaller() else ModDescription = string.Empty; + if (Document.SelectSingleNode("/mod").Attributes["version"] != null) + { + if (Version.TryParse(Document.SelectSingleNode("/mod").Attributes["version"].Value, out Version parsedVersion)) + ModVersion = parsedVersion; + else + throw new Exception("This mod has an invalid version. Please inform the mod's developer of this."); + } + else + ModVersion = null; + NameTextBlock.Text = displayName; DescriptionTextBlock.Text = ModDescription; @@ -757,6 +768,7 @@ await Dispatcher.BeginInvoke(new Action(() => ModConfiguration mod = new ModConfiguration(ModName, ModUnique) { DisplayName = ModDisplayName, + Version = ModVersion, ConfiguratorPath = Path.Combine(ModConfigPath, "ModInfo.xml") }; @@ -780,7 +792,8 @@ await Dispatcher.BeginInvoke(new Action(() => { ModConfiguration mod = new ModConfiguration(ModName, ModUnique) { - DisplayName = ModDisplayName + DisplayName = ModDisplayName, + Version = ModVersion, }; foreach (ComponentInfo c in Prerequisites) From a3eb4f998206fe34e45aa03df140db24eae1f220 Mon Sep 17 00:00:00 2001 From: Rosalie Wanders Date: Sat, 31 Jan 2026 22:14:36 +0100 Subject: [PATCH 3/7] Spore ModAPI Easy Uninstaller: add mod version to UninstallerForm --- .../UninstallerForm.Designer.cs | 9 +++++++++ Spore ModAPI Easy Uninstaller/UninstallerForm.cs | 15 ++++++++++----- .../UninstallerForm.resx | 3 +++ 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Spore ModAPI Easy Uninstaller/UninstallerForm.Designer.cs b/Spore ModAPI Easy Uninstaller/UninstallerForm.Designer.cs index f21f126..d7bac35 100644 --- a/Spore ModAPI Easy Uninstaller/UninstallerForm.Designer.cs +++ b/Spore ModAPI Easy Uninstaller/UninstallerForm.Designer.cs @@ -39,6 +39,7 @@ private void InitializeComponent() this.MainColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.ModNames = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ModDisplayNames = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ModVersions = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ModConfiguration = new System.Windows.Forms.DataGridViewCheckBoxColumn(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); this.SuspendLayout(); @@ -98,6 +99,7 @@ private void InitializeComponent() this.MainColumn, this.ModNames, this.ModDisplayNames, + this.ModVersions, this.ModConfiguration}); dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; @@ -150,6 +152,12 @@ private void InitializeComponent() this.ModDisplayNames.Name = "ModDisplayNames"; this.ModDisplayNames.ReadOnly = true; // + // ModVersions + // + this.ModVersions.HeaderText = "Mod Versions"; + this.ModVersions.Name = "ModVersions"; + this.ModVersions.ReadOnly = true; + // // ModConfiguration // this.ModConfiguration.HeaderText = "Mod Configuration"; @@ -186,6 +194,7 @@ private void InitializeComponent() private System.Windows.Forms.DataGridViewCheckBoxColumn MainColumn; private System.Windows.Forms.DataGridViewTextBoxColumn ModNames; private System.Windows.Forms.DataGridViewTextBoxColumn ModDisplayNames; + private System.Windows.Forms.DataGridViewTextBoxColumn ModVersions; private System.Windows.Forms.DataGridViewCheckBoxColumn ModConfiguration; } } diff --git a/Spore ModAPI Easy Uninstaller/UninstallerForm.cs b/Spore ModAPI Easy Uninstaller/UninstallerForm.cs index e3c7242..a309625 100644 --- a/Spore ModAPI Easy Uninstaller/UninstallerForm.cs +++ b/Spore ModAPI Easy Uninstaller/UninstallerForm.cs @@ -46,11 +46,16 @@ public void AddMods(HashSet mods) // add mods foreach (var mod in mods) { + string versionString = ""; + if (mod.Version != null) + { + versionString = mod.Version.ToString(); + } - int index = this.dataGridView1.Rows.Add(new object[] { false, mod, mod.DisplayName }); + int index = this.dataGridView1.Rows.Add(new object[] { false, mod, mod.DisplayName, versionString }); if (GetConfiguratorPath(index) != null) - this.dataGridView1.Rows[index].Cells[3].ReadOnly = true; + this.dataGridView1.Rows[index].Cells[4].ReadOnly = true; } // sort mods @@ -67,7 +72,7 @@ private void btnCancel_Click(object sender, EventArgs e) private void dataGridView_CellDoubleClick(Object sender, DataGridViewCellEventArgs e) { - if (e.RowIndex != 0 && e.ColumnIndex == 3 && GetConfiguratorPath(e.RowIndex) != null) + if (e.RowIndex != 0 && e.ColumnIndex == 4 && GetConfiguratorPath(e.RowIndex) != null) { // execute configurator and close uninstaller ExecuteConfigurator(GetModConfiguration(e.RowIndex)); @@ -80,7 +85,7 @@ private void dataGridView_CellDoubleClick(Object sender, DataGridViewCellEventAr private void dataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { - if (e.RowIndex != 0 && e.ColumnIndex == 3 && GetConfiguratorPath(e.RowIndex) != null) + if (e.RowIndex != 0 && e.ColumnIndex == 4 && GetConfiguratorPath(e.RowIndex) != null) { // execute configurator and close uninstaller ExecuteConfigurator(GetModConfiguration(e.RowIndex)); @@ -153,7 +158,7 @@ private void btnUninstall_Click(object sender, EventArgs e) private void dataGridView_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) { - if (e.ColumnIndex == 3 && this.dataGridView1.SelectedRows.Count > 0) + if (e.ColumnIndex == 4 && this.dataGridView1.SelectedRows.Count > 0) { if (e.RowIndex > 0) { diff --git a/Spore ModAPI Easy Uninstaller/UninstallerForm.resx b/Spore ModAPI Easy Uninstaller/UninstallerForm.resx index 896a66c..39e23a7 100644 --- a/Spore ModAPI Easy Uninstaller/UninstallerForm.resx +++ b/Spore ModAPI Easy Uninstaller/UninstallerForm.resx @@ -126,6 +126,9 @@ True + + True + True From 42197f89b8ca699186be80b780c98aceaddd8373 Mon Sep 17 00:00:00 2001 From: Rosalie Wanders Date: Sat, 31 Jan 2026 23:25:02 +0100 Subject: [PATCH 4/7] ModAPI.Common: add Dependencies and DependenciesVersions to ModConfiguration --- ModAPI.Common/InstalledMods.cs | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/ModAPI.Common/InstalledMods.cs b/ModAPI.Common/InstalledMods.cs index d82c1a6..fbb5aa9 100644 --- a/ModAPI.Common/InstalledMods.cs +++ b/ModAPI.Common/InstalledMods.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; +using System.Linq; using System.Xml; namespace ModAPI.Common @@ -55,6 +56,8 @@ public class ModConfiguration : IEquatable public Version Version; public string DisplayName; public string ConfiguratorPath; + public string[] Dependencies; + public Version[] DependenciesVersions; public List InstalledFiles = new List(); public ModConfiguration(string name, string unique) @@ -106,6 +109,20 @@ public void Save(XmlDocument document, XmlElement parent) element.Attributes.Append(versionAttribute); } + if (Dependencies != null && Dependencies.Length > 0) + { + var dependenciesAttribute = document.CreateAttribute("dependencies"); + dependenciesAttribute.Value = String.Join("?", Dependencies); + element.Attributes.Append(dependenciesAttribute); + } + + if (DependenciesVersions != null && DependenciesVersions.Length > 0) + { + var dependenciesVersionsAttribute = document.CreateAttribute("dependenciesVersions"); + dependenciesVersionsAttribute.Value = String.Join("?", DependenciesVersions.Select(x => x.ToString())); + element.Attributes.Append(dependenciesVersionsAttribute); + } + if (this.ConfiguratorPath != null) { attribute = document.CreateAttribute("configurator"); @@ -151,6 +168,35 @@ public void Load(XmlNode node) Version = null; } + var dependenciesAttribute = node.Attributes.GetNamedItem("dependencies"); + if (dependenciesAttribute != null) + { + Dependencies = dependenciesAttribute.Value.Split('?'); + } + + var dependenciesVersionsAttribute = node.Attributes.GetNamedItem("dependenciesVersions"); + if (dependenciesVersionsAttribute != null) + { + List versions = new List(); + foreach (string version in dependenciesVersionsAttribute.Value.Split('?')) + { + if (Version.TryParse(version, out Version parsedDependencyVersion)) + { + versions.Add(parsedDependencyVersion); + } + else + { + versions.Clear(); + break; + } + } + + if (versions.Count() != 0) + { + DependenciesVersions = versions.ToArray(); + } + } + var displayNameAttribute = node.Attributes.GetNamedItem("displayName"); if (displayNameAttribute != null) this.DisplayName = displayNameAttribute.Value; From 4c07ded97b3227e4e002529838d67bc5fb88fbff Mon Sep 17 00:00:00 2001 From: Rosalie Wanders Date: Sat, 31 Jan 2026 23:25:36 +0100 Subject: [PATCH 5/7] Spore ModAPI Easy Installer: add support for depends/dependsVersions attributes --- .../XmlInstallerWindow.xaml.cs | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/Spore ModAPI Easy Installer/XmlInstallerWindow.xaml.cs b/Spore ModAPI Easy Installer/XmlInstallerWindow.xaml.cs index 0616e97..ac2d668 100644 --- a/Spore ModAPI Easy Installer/XmlInstallerWindow.xaml.cs +++ b/Spore ModAPI Easy Installer/XmlInstallerWindow.xaml.cs @@ -38,6 +38,8 @@ public partial class XmlInstallerWindow : DecoratableWindow string ModConfigPath = string.Empty; string ModUnique = string.Empty; Version ModVersion = null; + List ModDependencies = new List(); + List ModDependenciesVersions = new List(); XmlDocument Document = new XmlDocument(); List Prerequisites = new List(); List CompatFiles = new List(); @@ -254,6 +256,78 @@ private void PrepareInstaller() else ModVersion = null; + if (Document.SelectSingleNode("/mod").Attributes["depends"] != null) + { + string dependsString = Document.SelectSingleNode("/mod").Attributes["depends"].Value; + string dependsVersionString = null; + if (Document.SelectSingleNode("/mod").Attributes["dependsVersions"] != null) + dependsVersionString = Document.SelectSingleNode("/mod").Attributes["dependsVersions"].Value; + string[] dependsUniqueNames = dependsString.Split('?'); + string[] dependsVersions = dependsVersionString == null ? null : dependsVersionString.Split('?'); + bool[] foundDepends = new bool[dependsUniqueNames.Length]; + // reset foundDepends + for (int i = 0; i < foundDepends.Length; i++) + foundDepends[i] = false; + + ModDependencies = dependsUniqueNames.ToList(); + if (dependsVersions != null) + { // TODO: improve this logic... + foreach (string dependsVersion in dependsVersions) + { + if (Version.TryParse(dependsVersion, out Version parsedDependsVersion)) + { + ModDependenciesVersions.Add(parsedDependsVersion); + } + } + } + + foreach (ModConfiguration mod in configs) + { + for (int i = 0; i < dependsUniqueNames.Length; i++) + { + if (mod.Unique == dependsUniqueNames[i]) + { + if (mod.Version != null && + (dependsVersions != null) && + (dependsVersions.Length > i) && + (Version.TryParse(dependsVersions[i], out Version dependVersion) && + mod.Version >= dependVersion)) + { // name + version match + foundDepends[i] = true; + break; + } + else if (dependsVersions == null || dependsVersions.Length <= i) + { // name only match + foundDepends[i] = true; + break; + } + } + } + } + + bool satisfiedDepends = true; + List missingDepends = new List(); + for (int i = 0; i < foundDepends.Length; i++) + { + if (!foundDepends[i]) + { + satisfiedDepends = false; + string missingDependsText = dependsUniqueNames[i]; + if (dependsVersions != null && + dependsVersions.Length > i) + { + missingDependsText += " " + dependsVersions[i]; + } + missingDepends.Add(missingDependsText); + } + } + + if (!satisfiedDepends) + { + throw new Exception($"This mod has dependencies that you don't have installed: {String.Join(", ", missingDepends)}"); + } + } + NameTextBlock.Text = displayName; DescriptionTextBlock.Text = ModDescription; @@ -769,6 +843,8 @@ await Dispatcher.BeginInvoke(new Action(() => { DisplayName = ModDisplayName, Version = ModVersion, + Dependencies = ModDependencies.ToArray(), + DependenciesVersions = ModDependenciesVersions.ToArray(), ConfiguratorPath = Path.Combine(ModConfigPath, "ModInfo.xml") }; @@ -794,6 +870,8 @@ await Dispatcher.BeginInvoke(new Action(() => { DisplayName = ModDisplayName, Version = ModVersion, + Dependencies = ModDependencies.ToArray(), + DependenciesVersions = ModDependenciesVersions.ToArray(), }; foreach (ComponentInfo c in Prerequisites) From 2e17074595d9dee145e4200e5ff25ee3937ae2a3 Mon Sep 17 00:00:00 2001 From: Rosalie Wanders Date: Sat, 31 Jan 2026 23:25:57 +0100 Subject: [PATCH 6/7] Spore ModAPI Easy Uninstaller: add support for depends/dependsVersions attributes --- .../EasyUninstaller.cs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Spore ModAPI Easy Uninstaller/EasyUninstaller.cs b/Spore ModAPI Easy Uninstaller/EasyUninstaller.cs index f7f0f0a..d5ec06f 100644 --- a/Spore ModAPI Easy Uninstaller/EasyUninstaller.cs +++ b/Spore ModAPI Easy Uninstaller/EasyUninstaller.cs @@ -75,6 +75,31 @@ public static void UninstallMods(Dictionary mods) try { + // ensure we don't remove a mod which + // is a dependency of another mod + List modDependencies = new List(); + List reliantMods = new List(); + foreach (var mod in Mods.ModConfigurations) + { + foreach (var uninstallMod in mods) + { + if (mod.Dependencies != null && + mod.Dependencies.Contains(uninstallMod.Key.Unique) && + !mods.Select(x => x.Key.Unique).Contains(mod.Unique)) + { + modDependencies.Add(uninstallMod.Key.DisplayName); + if (!reliantMods.Contains(mod.DisplayName)) + reliantMods.Add(mod.DisplayName); + } + } + } + + if (modDependencies.Count() > 0) + { + MessageBox.Show($"Cannot uninstall {String.Join(", ", modDependencies.ToArray())} because {String.Join(", ", reliantMods.ToArray())} relies on them being installed!", CommonStrings.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + foreach (var mod in mods) { ResultType result = ResultType.Success; From 7295fea66f770511f9f30b482b34e54281ebecb3 Mon Sep 17 00:00:00 2001 From: Rosalie Wanders Date: Wed, 4 Feb 2026 00:19:58 +0100 Subject: [PATCH 7/7] Spore ModAPI Easy Installer: lock version/depends/dependsVersions behind installerSystemVersion 1.0.1.3 --- .../XmlInstallerWindow.xaml.cs | 139 ++++++++++-------- 1 file changed, 77 insertions(+), 62 deletions(-) diff --git a/Spore ModAPI Easy Installer/XmlInstallerWindow.xaml.cs b/Spore ModAPI Easy Installer/XmlInstallerWindow.xaml.cs index ac2d668..4636396 100644 --- a/Spore ModAPI Easy Installer/XmlInstallerWindow.xaml.cs +++ b/Spore ModAPI Easy Installer/XmlInstallerWindow.xaml.cs @@ -157,7 +157,8 @@ private void PrepareInstaller() if ((ModInfoVersion == new Version(1, 0, 0, 0)) || (ModInfoVersion == new Version(1, 0, 1, 0)) || (ModInfoVersion == new Version(1, 0, 1, 1)) || - (ModInfoVersion == new Version(1, 0, 1, 2))) + (ModInfoVersion == new Version(1, 0, 1, 2)) || + (ModInfoVersion == new Version(1, 0, 1, 3))) { if (File.Exists(Path.Combine(ModConfigPath, "Branding.png"))) { @@ -185,7 +186,8 @@ private void PrepareInstaller() } else if ((ModInfoVersion == new Version(1, 0, 1, 0)) || (ModInfoVersion == new Version(1, 0, 1, 1)) || - (ModInfoVersion == new Version(1, 0, 1, 2))) + (ModInfoVersion == new Version(1, 0, 1, 2)) || + (ModInfoVersion == new Version(1, 0, 1, 3))) { _dontUseLegacyPackagePlacement = true; _installerMode = 1; @@ -246,85 +248,98 @@ private void PrepareInstaller() else ModDescription = string.Empty; - if (Document.SelectSingleNode("/mod").Attributes["version"] != null) + // installerSystemVersion 1.0.1.3 introduced the version, depends and dependsVersion attributes + if (ModInfoVersion == new Version(1, 0, 1, 3)) { - if (Version.TryParse(Document.SelectSingleNode("/mod").Attributes["version"].Value, out Version parsedVersion)) - ModVersion = parsedVersion; + if (Document.SelectSingleNode("/mod").Attributes["version"] != null) + { + if (Version.TryParse(Document.SelectSingleNode("/mod").Attributes["version"].Value, out Version parsedVersion)) + ModVersion = parsedVersion; + else + throw new Exception("This mod has an invalid version. Please inform the mod's developer of this."); + } else - throw new Exception("This mod has an invalid version. Please inform the mod's developer of this."); - } - else - ModVersion = null; + ModVersion = null; - if (Document.SelectSingleNode("/mod").Attributes["depends"] != null) - { - string dependsString = Document.SelectSingleNode("/mod").Attributes["depends"].Value; - string dependsVersionString = null; - if (Document.SelectSingleNode("/mod").Attributes["dependsVersions"] != null) - dependsVersionString = Document.SelectSingleNode("/mod").Attributes["dependsVersions"].Value; - string[] dependsUniqueNames = dependsString.Split('?'); - string[] dependsVersions = dependsVersionString == null ? null : dependsVersionString.Split('?'); - bool[] foundDepends = new bool[dependsUniqueNames.Length]; - // reset foundDepends - for (int i = 0; i < foundDepends.Length; i++) - foundDepends[i] = false; - - ModDependencies = dependsUniqueNames.ToList(); - if (dependsVersions != null) - { // TODO: improve this logic... - foreach (string dependsVersion in dependsVersions) + if (Document.SelectSingleNode("/mod").Attributes["depends"] != null) + { + string dependsString = Document.SelectSingleNode("/mod").Attributes["depends"].Value; + string dependsVersionString = null; + if (Document.SelectSingleNode("/mod").Attributes["dependsVersions"] != null) + dependsVersionString = Document.SelectSingleNode("/mod").Attributes["dependsVersions"].Value; + string[] dependsUniqueNames = dependsString.Split('?'); + string[] dependsVersions = dependsVersionString?.Split('?'); + bool[] foundDepends = new bool[dependsUniqueNames.Length]; + + ModDependencies = dependsUniqueNames.ToList(); + if (dependsVersions != null) { - if (Version.TryParse(dependsVersion, out Version parsedDependsVersion)) + foreach (string dependsVersion in dependsVersions) { - ModDependenciesVersions.Add(parsedDependsVersion); + if (String.IsNullOrEmpty(dependsVersion)) + { // 0.0.0.0 is interpreted as having no version attribute + // but we need to pad the list to match the amount of items + // that ModDependencies has + ModDependenciesVersions.Add(new Version(0, 0, 0, 0)); + } + else + { + if (Version.TryParse(dependsVersion, out Version parsedDependsVersion)) + { + ModDependenciesVersions.Add(parsedDependsVersion); + } + else + { + throw new Exception($"This mod has an invalid dependsVersions entry: \"{dependsVersion}\". Please inform the mod's developer of this."); + } + } } } - } - foreach (ModConfiguration mod in configs) - { - for (int i = 0; i < dependsUniqueNames.Length; i++) + foreach (ModConfiguration mod in configs) { - if (mod.Unique == dependsUniqueNames[i]) + for (int i = 0; i < dependsUniqueNames.Length; i++) { - if (mod.Version != null && - (dependsVersions != null) && - (dependsVersions.Length > i) && - (Version.TryParse(dependsVersions[i], out Version dependVersion) && - mod.Version >= dependVersion)) - { // name + version match - foundDepends[i] = true; - break; - } - else if (dependsVersions == null || dependsVersions.Length <= i) - { // name only match - foundDepends[i] = true; - break; + if (mod.Unique == dependsUniqueNames[i]) + { + if (mod.Version != null && + (ModDependenciesVersions.Count() > i) && + (mod.Version >= ModDependenciesVersions[i])) + { // name + version match + foundDepends[i] = true; + break; + } + else if (ModDependenciesVersions.Count() <= i || + ModDependenciesVersions[i] == new Version(0, 0, 0, 0)) + { // name only match + foundDepends[i] = true; + break; + } } } } - } - bool satisfiedDepends = true; - List missingDepends = new List(); - for (int i = 0; i < foundDepends.Length; i++) - { - if (!foundDepends[i]) + bool satisfiedDepends = true; + List missingDepends = new List(); + for (int i = 0; i < foundDepends.Length; i++) { - satisfiedDepends = false; - string missingDependsText = dependsUniqueNames[i]; - if (dependsVersions != null && - dependsVersions.Length > i) + if (!foundDepends[i]) { - missingDependsText += " " + dependsVersions[i]; + satisfiedDepends = false; + string missingDependsText = dependsUniqueNames[i]; + if (dependsVersions != null && + dependsVersions.Length > i) + { + missingDependsText += " " + dependsVersions[i]; + } + missingDepends.Add(missingDependsText); } - missingDepends.Add(missingDependsText); } - } - if (!satisfiedDepends) - { - throw new Exception($"This mod has dependencies that you don't have installed: {String.Join(", ", missingDepends)}"); + if (!satisfiedDepends) + { + throw new Exception($"This mod has dependencies that you don't have installed: {String.Join(", ", missingDepends)}"); + } } }