update report information and add WABBAJACK_NOMATCH_INCLUDE

This commit is contained in:
Timothy Baldridge 2019-09-20 16:49:32 -06:00
parent fdfa972392
commit f90260fed0
5 changed files with 29 additions and 5 deletions

View File

@ -1,6 +1,8 @@
### Changelog
#### Version 0.9.3 - ???
* Add WABBAJACK_NOMATCH_INCLUDE works like WABBAJACK_INCLUDE but only includes files that are found to be missing at the end of compilation
* Add a list of all inlined data blobs to the install report, useful for reducing installer sizes
#### Version 0.9.2 - 9/18/2013
* Fixed a bug with BSA string encoding

View File

@ -22,6 +22,7 @@ namespace Wabbajack.Common
public static string WABBAJACK_INCLUDE = "WABBAJACK_INCLUDE";
public static string WABBAJACK_ALWAYS_ENABLE = "WABBAJACK_ALWAYS_ENABLE";
public static string WABBAJACK_NOMATCH_INCLUDE = "WABBAJACK_NOMATCH_INCLUDE";
public static string GAME_PATH_MAGIC_BACK = "{--||GAME_PATH_MAGIC_BACK||--}";
public static string GAME_PATH_MAGIC_DOUBLE_BACK = "{--||GAME_PATH_MAGIC_DOUBLE_BACK||--}";
@ -42,6 +43,7 @@ namespace Wabbajack.Common
public static HashSet<string> GameESMs = new HashSet<string>
{"Skyrim.esm", "Update.esm", "Dawnguard.esm", "HearthFires.esm", "Dragonborn.esm"};
public static string UserAgent
{
get

View File

@ -423,6 +423,11 @@ namespace Wabbajack.Common
return Math.Sign(byteCount) * num + Suffix[place];
}
public static string ToFileSizeString(this int byteCount)
{
return ToFileSizeString((long)byteCount);
}
public static void CreatePatch(byte[] a, byte[] b, Stream output)
{
var data_a = a.SHA256().FromBase64().ToHEX();

View File

@ -538,7 +538,7 @@ namespace Wabbajack
IgnoreRegex(Consts.GameFolderFilesDir + "\\\\.*\\.bsa"),
IncludeModIniData(),
DirectMatch(),
IncludeTaggedFiles(),
IncludeTaggedFiles(Consts.WABBAJACK_INCLUDE),
DeconstructBSAs(), // Deconstruct BSAs before building patches so we don't generate massive patch files
IncludePatches(),
IncludeDummyESPs(),
@ -565,6 +565,7 @@ namespace Wabbajack
PatchStockESMs(),
IncludeAllConfigs(),
IncludeTaggedFiles(Consts.WABBAJACK_NOMATCH_INCLUDE),
DropAll()
};
@ -700,14 +701,14 @@ namespace Wabbajack
/// mod will be inlined into the installer. USE WISELY.
/// </summary>
/// <returns></returns>
private Func<RawSourceFile, Directive> IncludeTaggedFiles()
private Func<RawSourceFile, Directive> IncludeTaggedFiles(string tag)
{
var include_directly = ModInis.Where(kv =>
{
var general = kv.Value.General;
if (general.notes != null && general.notes.Contains(Consts.WABBAJACK_INCLUDE))
if (general.notes != null && general.notes.Contains(tag))
return true;
if (general.comments != null && general.comments.Contains(Consts.WABBAJACK_INCLUDE))
if (general.comments != null && general.comments.Contains(tag))
return true;
return false;
}).Select(kv => $"mods\\{kv.Key}\\");

View File

@ -100,13 +100,27 @@ namespace Wabbajack
NoWrapText($"* `{i.To}` by remapping the contents of an inline file");
break;
case InlineFile i:
NoWrapText($"* `{i.To}` from `{i.SourceData.Length}` byte file included in modlist");
NoWrapText($"* `{i.To}` from `{i.SourceData.Length.ToFileSizeString()}` file included in modlist");
break;
case CreateBSA i:
NoWrapText(
$"* `{i.To}` by creating a BSA of files found in `{Consts.BSACreationDir}\\{i.TempID}`");
break;
}
var inlined = lst.Directives.OfType<InlineFile>()
.Select(f => (f.To, "inlined", f.SourceData.Length))
.Concat(lst.Directives
.OfType<PatchedFromArchive>()
.Select(f => (f.To, "patched", f.Patch.Length)))
.ToHashSet()
.OrderByDescending(f => f.Length);
NoWrapText("\n\n### Summary of inlined files in this installer");
foreach (var inline in inlined)
{
NoWrapText($"* {inline.Length.ToFileSizeString()} for {inline.Item2} file {inline.To}");
}
}
private IEnumerable<Archive> SortArchives(List<Archive> lstArchives)