diff --git a/Wabbajack.CLI/Verbs/ModlistReport.cs b/Wabbajack.CLI/Verbs/ModlistReport.cs index 64f31f96..dd9fdd96 100644 --- a/Wabbajack.CLI/Verbs/ModlistReport.cs +++ b/Wabbajack.CLI/Verbs/ModlistReport.cs @@ -70,7 +70,7 @@ public class ModlistReport string FixupTo(RelativePath path) { - if (path.GetPart(0) != StandardInstaller.BSACreationDir.ToString()) return path.ToString(); + if (path.GetPart(0) != Consts.BSACreationDir.ToString()) return path.ToString(); var bsaId = path.GetPart(1); if (!bsas.TryGetValue(bsaId, out var bsa)) diff --git a/Wabbajack.CLI/Verbs/VerifyModlistInstall.cs b/Wabbajack.CLI/Verbs/VerifyModlistInstall.cs index c0e033ba..fc1f3fbb 100644 --- a/Wabbajack.CLI/Verbs/VerifyModlistInstall.cs +++ b/Wabbajack.CLI/Verbs/VerifyModlistInstall.cs @@ -42,10 +42,28 @@ public class VerifyModlistInstall _logger.LogInformation("Scanning files"); foreach (var directive in list.Directives) { + if (directive is ArchiveMeta) + continue; + + if (directive is RemappedInlineFile) + continue; + + if (directive.To.InFolder(Consts.BSACreationDir)) + continue; + var dest = directive.To.RelativeTo(installFolder); + if (!dest.FileExists()) + { + errors.Add(new Result + { + Path = directive.To, + Message = $"File does not exist directive {directive.GetType()}" + }); + continue; + } if (dest.Size() != directive.Size) { - errors.Add(new Result() + errors.Add(new Result { Path = directive.To, Message = $"Sizes do not match got {dest.Size()} expected {directive.Size}" diff --git a/Wabbajack.Installer/AInstaller.cs b/Wabbajack.Installer/AInstaller.cs index 28784921..1fa6b156 100644 --- a/Wabbajack.Installer/AInstaller.cs +++ b/Wabbajack.Installer/AInstaller.cs @@ -41,7 +41,7 @@ public abstract class AInstaller where T : AInstaller { private const int _limitMS = 100; - public static RelativePath BSACreationDir = "TEMP_BSA_FILES".ToRelativePath(); + private static readonly Regex NoDeleteRegex = new(@"(?i)[\\\/]\[NoDelete\]", RegexOptions.Compiled); protected readonly InstallerConfiguration _configuration; @@ -498,8 +498,8 @@ public abstract class AInstaller return d switch { CreateBSA bsa => !bsasToNotBuild.Contains(bsa.TempID), - FromArchive a when a.To.StartsWith($"{BSACreationDir}") => !bsasToNotBuild.Any(b => - a.To.RelativeTo(_configuration.Install).InFolder(_configuration.Install.Combine(BSACreationDir, b))), + FromArchive a when a.To.StartsWith($"{Consts.BSACreationDir}") => !bsasToNotBuild.Any(b => + a.To.RelativeTo(_configuration.Install).InFolder(_configuration.Install.Combine(Consts.BSACreationDir, b))), _ => true }; }).ToDictionary(d => d.To); diff --git a/Wabbajack.Installer/Consts.cs b/Wabbajack.Installer/Consts.cs index a4c81009..37f5b39c 100644 --- a/Wabbajack.Installer/Consts.cs +++ b/Wabbajack.Installer/Consts.cs @@ -26,4 +26,5 @@ public static class Consts public const string StepDownloading = "Downloading"; public const string StepHashing = "Hashing"; public const string StepFinished = "Finished"; + public static RelativePath BSACreationDir = "TEMP_BSA_FILES".ToRelativePath(); } \ No newline at end of file diff --git a/Wabbajack.Installer/StandardInstaller.cs b/Wabbajack.Installer/StandardInstaller.cs index 47f11965..38ec25cb 100644 --- a/Wabbajack.Installer/StandardInstaller.cs +++ b/Wabbajack.Installer/StandardInstaller.cs @@ -282,7 +282,7 @@ public class StandardInstaller : AInstaller { UpdateProgress(1); _logger.LogInformation("Building {bsaTo}", bsa.To.FileName); - var sourceDir = _configuration.Install.Combine(BSACreationDir, bsa.TempID); + var sourceDir = _configuration.Install.Combine(Consts.BSACreationDir, bsa.TempID); await using var a = BSADispatch.CreateBuilder(bsa.State, _manager); var streams = await bsa.FileStates.PMapAllBatchedAsync(_limiter, async state => @@ -314,7 +314,7 @@ public class StandardInstaller : AInstaller var hash = await stream.Hash(token); var astate = bsa.FileStates.First(f => f.Path == state.Path); - var srcDirective = indexedByDestination[BSACreationDir.Combine(bsa.TempID, astate.Path)]; + var srcDirective = indexedByDestination[Consts.BSACreationDir.Combine(bsa.TempID, astate.Path)]; //DX10Files are lossy if (astate is not BA2DX10File) ThrowOnNonMatchingHash(bsa, srcDirective, astate, hash); @@ -322,10 +322,10 @@ public class StandardInstaller : AInstaller }).ToHashSet(); } - var bsaDir = _configuration.Install.Combine(BSACreationDir); + var bsaDir = _configuration.Install.Combine(Consts.BSACreationDir); if (bsaDir.DirectoryExists()) { - _logger.LogInformation("Removing temp folder {bsaCreationDir}", BSACreationDir); + _logger.LogInformation("Removing temp folder {bsaCreationDir}", Consts.BSACreationDir); bsaDir.DeleteDirectory(); } }