diff --git a/src/XIVLauncher.Common/Dalamud/DalamudUpdater.cs b/src/XIVLauncher.Common/Dalamud/DalamudUpdater.cs index 5120ee72..83a2f09d 100644 --- a/src/XIVLauncher.Common/Dalamud/DalamudUpdater.cs +++ b/src/XIVLauncher.Common/Dalamud/DalamudUpdater.cs @@ -400,6 +400,15 @@ private static void WriteVersionJson(DirectoryInfo addonPath, string info) File.WriteAllText(Path.Combine(addonPath.FullName, "version.json"), info); } + public static void CopyFilesRecursively(DirectoryInfo source, DirectoryInfo target) + { + foreach (DirectoryInfo dir in source.GetDirectories()) + CopyFilesRecursively(dir, target.CreateSubdirectory(dir.Name)); + + foreach (FileInfo file in source.GetFiles()) + file.CopyTo(Path.Combine(target.FullName, file.Name)); + } + private async Task DownloadDalamud(DirectoryInfo addonPath, DalamudVersionInfo version) { // Ensure directory exists @@ -433,10 +442,7 @@ private async Task DownloadDalamud(DirectoryInfo addonPath, DalamudVersionInfo v devPath.Create(); } - foreach (var fileInfo in addonPath.GetFiles()) - { - fileInfo.CopyTo(Path.Combine(devPath.FullName, fileInfo.Name)); - } + CopyFilesRecursively(addonPath, devPath); } catch (Exception ex) {