diff --git a/Flatpak/io.github.TeamWheelWizard.WheelWizard.metainfo.xml b/Flatpak/io.github.TeamWheelWizard.WheelWizard.metainfo.xml index 5ac6b982..6b9ac1f8 100644 --- a/Flatpak/io.github.TeamWheelWizard.WheelWizard.metainfo.xml +++ b/Flatpak/io.github.TeamWheelWizard.WheelWizard.metainfo.xml @@ -55,6 +55,7 @@ + diff --git a/WheelWizard/Features/CustomDistributions/RetroRewindBeta.cs b/WheelWizard/Features/CustomDistributions/RetroRewindBeta.cs index 86ad4148..4073b831 100644 --- a/WheelWizard/Features/CustomDistributions/RetroRewindBeta.cs +++ b/WheelWizard/Features/CustomDistributions/RetroRewindBeta.cs @@ -211,7 +211,9 @@ out bool badPassword continue; if (!TryGetRelativeExtractionPath(normalized, out var relativePath)) - return Fail("Unexpected file in the test archive. Please contact the developers."); + return Fail( + $"Unexpected file in the test archive: '{entry.Key}' (normalized: '{normalized}'). Please contact the developers." + ); if (!PathSafetyHelper.TryGetPathWithinDirectory(destinationDirectory, relativePath, out var destinationPath)) return Fail("The file path is outside the destination directory. Please contact the developers."); @@ -254,33 +256,31 @@ private static bool IsBadPasswordException(Exception ex) private bool TryGetRelativeExtractionPath(string normalizedPath, out string relativePath) { relativePath = string.Empty; + var archivePath = normalizedPath.Replace(Path.DirectorySeparatorChar, '/').Replace(Path.AltDirectorySeparatorChar, '/'); - if (normalizedPath.Equals(FolderName, StringComparison.OrdinalIgnoreCase)) + if (archivePath.Equals(FolderName, StringComparison.OrdinalIgnoreCase)) { relativePath = FolderName; return true; } - if (normalizedPath.StartsWith($"{FolderName}/", StringComparison.OrdinalIgnoreCase)) + if (archivePath.StartsWith($"{FolderName}/", StringComparison.OrdinalIgnoreCase)) { - relativePath = Path.Combine( - FolderName, - normalizedPath.Substring(FolderName.Length + 1).Replace('/', Path.DirectorySeparatorChar) - ); + relativePath = Path.Combine(FolderName, archivePath.Substring(FolderName.Length + 1).Replace('/', Path.DirectorySeparatorChar)); return true; } - if (normalizedPath.Equals(XMLFolderName, StringComparison.OrdinalIgnoreCase)) + if (archivePath.Equals(XMLFolderName, StringComparison.OrdinalIgnoreCase)) { relativePath = XMLFolderName; return true; } - if (normalizedPath.StartsWith($"{XMLFolderName}/", StringComparison.OrdinalIgnoreCase)) + if (archivePath.StartsWith($"{XMLFolderName}/", StringComparison.OrdinalIgnoreCase)) { relativePath = Path.Combine( XMLFolderName, - normalizedPath.Substring(XMLFolderName.Length + 1).Replace('/', Path.DirectorySeparatorChar) + archivePath.Substring(XMLFolderName.Length + 1).Replace('/', Path.DirectorySeparatorChar) ); return true; } diff --git a/WheelWizard/WheelWizard.csproj b/WheelWizard/WheelWizard.csproj index 742c2544..9a52f084 100644 --- a/WheelWizard/WheelWizard.csproj +++ b/WheelWizard/WheelWizard.csproj @@ -12,7 +12,7 @@ $(NoWarn);AVLN3001 - 2.4.8 + 2.4.9 This program will manage RetroRewind and mods :) GNU v3.0 https://github.com/patchzyy/WheelWizard