diff --git a/Wabbajack.CacheServer.Test/Wabbajack.CacheServer.Test.csproj b/Wabbajack.CacheServer.Test/Wabbajack.CacheServer.Test.csproj index d3e0ed9f..ada745bb 100644 --- a/Wabbajack.CacheServer.Test/Wabbajack.CacheServer.Test.csproj +++ b/Wabbajack.CacheServer.Test/Wabbajack.CacheServer.Test.csproj @@ -86,10 +86,10 @@ - 1.3.2 + 2.0.0 - 1.3.2 + 2.0.0 4.2.0 diff --git a/Wabbajack.Lib/AInstaller.cs b/Wabbajack.Lib/AInstaller.cs index a17a7983..7749dd1c 100644 --- a/Wabbajack.Lib/AInstaller.cs +++ b/Wabbajack.Lib/AInstaller.cs @@ -297,8 +297,11 @@ namespace Wabbajack.Lib .Do(g => { var required = g.Sum(i => i.Item2); + var contains = g.Sum(folder => + Directory.EnumerateFiles(folder.Item1, "*", DirectoryEnumerationOptions.Recursive) + .Sum(file => new FileInfo(file).Length)); var available = DriveInfo(g.Key).FreeBytesAvailable; - if (required > available) + if (required - contains > available) throw new NotEnoughDiskSpaceException( $"This modlist requires {required.ToFileSizeString()} on {g.Key} but only {available.ToFileSizeString()} is available."); });