diff --git a/NSMBe5/Plugin/PluginManager.cs b/NSMBe5/Plugin/PluginManager.cs index fb78072..ce4c6b3 100644 --- a/NSMBe5/Plugin/PluginManager.cs +++ b/NSMBe5/Plugin/PluginManager.cs @@ -38,7 +38,7 @@ public static int LoadPlugin(string pluginPath) Assembly pluginAsm; Type pluginClass; string pluginName; - + try { pluginAsm = Assembly.LoadFile(pluginPath); diff --git a/NSMBe5/Plugin/PluginSelector.cs b/NSMBe5/Plugin/PluginSelector.cs index 468f55e..d94d628 100644 --- a/NSMBe5/Plugin/PluginSelector.cs +++ b/NSMBe5/Plugin/PluginSelector.cs @@ -67,9 +67,17 @@ private void installButton_Click(object sender, EventArgs e) foreach (string path in dialog.FileNames) { - string dest = System.IO.Path.Combine(pluginPath, System.IO.Path.GetFileName(path)); + string file = System.IO.Path.GetFileName(path); - System.IO.File.Copy(path, dest); + string dest = System.IO.Path.Combine(pluginPath, file); + + if (System.IO.File.Exists(dest)) + { + MessageBox.Show($"Plugin \"{file}\" already exists", "Plugin Selector", MessageBoxButtons.OK, MessageBoxIcon.Error); + continue; + } + + System.IO.File.Copy(path, dest); PluginManager.LoadPlugin(dest); }