diff --git a/DS ROM Patcher/NDSand3DSCore.vb b/DS ROM Patcher/NDSand3DSCore.vb index e515b69..e2d0065 100644 --- a/DS ROM Patcher/NDSand3DSCore.vb +++ b/DS ROM Patcher/NDSand3DSCore.vb @@ -110,6 +110,11 @@ ShowFormatDialog: Dim formatDialog As New ThreeDSFormatSelector '- Build Select Case outputFormat Case DSFormat.Luma + If Directory.Exists(destinationPath) Then + Directory.Delete(destinationPath, True) + End If + Directory.CreateDirectory(destinationPath) + Dim titleId = Await DotNet3dsToolkit.MetadataReader.GetGameID(SelectedFilename) Dim baseTargetPath = Path.Combine(destinationPath, "luma", "titles", titleId) For Each file In filesModified @@ -119,10 +124,9 @@ ShowFormatDialog: Dim formatDialog As New ThreeDSFormatSelector 'Create directory if it doesn't exist Dim destDir = Path.GetDirectoryName(destFile) - If Directory.Exists(destDir) Then - Directory.Delete(destDir, True) + If Not Directory.Exists(destDir) Then + Directory.CreateDirectory(destDir) End If - Directory.CreateDirectory(destDir) IO.File.Copy(sourceFile, destFile) Next