From a04b7a5547bf3a5bddcf87229699e99ee38d10cf Mon Sep 17 00:00:00 2001 From: Shank Date: Wed, 8 Jun 2011 04:25:29 -0600 Subject: [PATCH] Updater removes all TShockAPI files from serverplugins folder in the event that somehow there are multiple copies. Closes #56 --- Update/Program.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Update/Program.cs b/Update/Program.cs index 74b8a367..65647a35 100644 --- a/Update/Program.cs +++ b/Update/Program.cs @@ -55,7 +55,19 @@ namespace Update try { - File.Delete("serverplugins/TShockAPI.dll"); + DirectoryInfo di = new DirectoryInfo("serverplugins"); + FileInfo[] fi = di.GetFiles(); + for (int i = 0; i < fi.Length; i ++ ) + { + if (fi[i].Name.ToLowerInvariant().Contains("tshockapi")) + { + fi[i].Delete(); + } + } + if (System.IO.File.Exists("serverplugins/TShockAPI.dll")) + { + System.IO.File.Delete("serverplugins/TShockAPI.dll"); + } } catch (FileNotFoundException) {