Explorar el Código

PRS SERVER - bug fix for when "update" folder does not already exist

Nick-PRSDigital@bitbucket.org hace 2 años
padre
commit
ea7bd1ac88
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      prs.server/Engines/Database/DatabaseEngine.cs

+ 6 - 1
prs.server/Engines/Database/DatabaseEngine.cs

@@ -377,7 +377,12 @@ namespace PRSServer
         private static void CopyFile(string filename)
         {
             var source = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "update", filename);
-            var target = Path.Combine(CoreUtils.GetCommonAppData("PRSServer"), "update", filename);
+
+            var targetdir = Path.Combine(CoreUtils.GetCommonAppData("PRSServer"), "update");
+            if (!Directory.Exists(targetdir))
+                Directory.CreateDirectory(targetdir);
+            var target = Path.Combine(targetdir, filename);
+
             File.Copy(source, target, true);
         }
         public static void MoveUpdateFiles()