diff --git a/SuperGrate/Classes/FileOperations.cs b/SuperGrate/Classes/FileOperations.cs index 8d0340d..d2f8c54 100644 --- a/SuperGrate/Classes/FileOperations.cs +++ b/SuperGrate/Classes/FileOperations.cs @@ -42,26 +42,18 @@ public static bool CopyFolder(string Source, string Destination) { DirectoryInfo source = new DirectoryInfo(Source); FileInfo[] sourceFiles = source.GetFiles("*", SearchOption.AllDirectories); - string lastStrippedPath = null; Logger.UpdateProgress(0); int progress = 0; foreach (FileInfo file in sourceFiles) { if (USMT.Canceled) break; - string strippedFullPath = file.FullName.Replace(source.FullName, "").Replace(@"\", ""); - string strippedPath = strippedFullPath.Replace(file.Name, ""); - if (strippedPath != lastStrippedPath) - { - string targetDirectory = Path.Combine(Destination, strippedPath); - if (!Directory.Exists(targetDirectory)) - { - Directory.CreateDirectory(targetDirectory); - } - lastStrippedPath = strippedPath; - } - string DestinationPath = Path.Combine(Destination, strippedFullPath); - Logger.Verbose(file.FullName + " => " + DestinationPath); - file.CopyTo(DestinationPath, true); + string strippedFullPath = file.FullName.Replace(source.FullName, ""); + string destinationFullPath = Destination + strippedFullPath; + string relativeDirectoryPath = file.DirectoryName.Replace(source.FullName, ""); + string destinationDirectoryPath = Destination + relativeDirectoryPath; + if (!Directory.Exists(destinationDirectoryPath)) Directory.CreateDirectory(destinationDirectoryPath); + file.CopyTo(destinationFullPath, true); + Logger.Verbose(file.FullName + " => " + destinationFullPath); Logger.UpdateProgress(progress++, sourceFiles.Length); } return !USMT.Canceled; diff --git a/SuperGrate/Properties/AssemblyInfo.cs b/SuperGrate/Properties/AssemblyInfo.cs index 74c42e1..8d6eab9 100644 --- a/SuperGrate/Properties/AssemblyInfo.cs +++ b/SuperGrate/Properties/AssemblyInfo.cs @@ -14,4 +14,4 @@ [assembly: Guid("2f05c2fb-1f11-4d53-9d9d-c8cec72ab64e")] -[assembly: AssemblyVersion("1.3.1.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.3.2.0")] \ No newline at end of file