Switch back to the non-core version of CEF due to production issues

This commit is contained in:
Timothy Baldridge 2021-03-24 16:20:59 -06:00
parent 9aa074c803
commit dccfef0067
5 changed files with 66 additions and 4 deletions

View File

@ -1,7 +1,9 @@
### Changelog
#### Version - 2.4.3.0 - 3/20/2021
#### Version - 2.4.3.1 - 3/24/2021
* HOTFIX : Go back to the non-core version of CEF, .NET Core version was crashing
* Folders prefixed with `[NoDelete]` in the name will be ignored when WJ cleans a installed modlist
* Resolution detection and setting is now supported for `SSEDisplayTweaks.ini` and `Oblivion.ini`
#### Version - 2.4.3.0 - 3/20/2021
* CDN part uploads are now retried

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Wabbajack.Common;
using Wabbajack.Lib.Downloaders;
@ -360,6 +361,7 @@ namespace Wabbajack.Lib
var savePath = (RelativePath)"saves";
UpdateTracker.NextStep("Looking for files to delete");
var regex = new Regex(@"(?i)[\\\/]\[NoDelete\]");
await OutputFolder.EnumerateFiles()
.PMap(Queue, UpdateTracker, async f =>
{
@ -368,7 +370,10 @@ namespace Wabbajack.Lib
return;
if (f.InFolder(profileFolder) && f.Parent.FileName == savePath) return;
if (regex.IsMatch(f.ToString()))
return;
Utils.Log($"Deleting {relativeTo} it's not part of this ModList");
await f.DeleteAsync();
});

View File

@ -461,7 +461,6 @@ namespace Wabbajack.Lib
// There are some types of files that will error the compilation, because they're created on-the-fly via tools
// so if we don't have a match by this point, just drop them.
new IgnoreEndsWith(this, ".ini"),
new IgnoreEndsWith(this, ".html"),
new IgnoreEndsWith(this, ".txt"),
// Don't know why, but this seems to get copied around a bit

View File

@ -409,8 +409,9 @@ namespace Wabbajack.Lib
throw new ArgumentNullException("System Parameters was null. Cannot set screen size prefs");
}
var config = new IniParserConfiguration {AllowDuplicateKeys = true, AllowDuplicateSections = true};
var oblivionPath = (RelativePath)"Oblivion.ini";
foreach (var file in OutputFolder.Combine("profiles").EnumerateFiles()
.Where(f => ((string)f.FileName).EndsWith("refs.ini")))
.Where(f => ((string)f.FileName).EndsWith("refs.ini") || f.FileName == oblivionPath))
{
try
{
@ -448,6 +449,36 @@ namespace Wabbajack.Lib
Utils.Log($"Skipping screen size remap for {file} due to parse error.");
}
}
var tweaksPath = (RelativePath)"SSEDisplayTweaks.ini";
foreach (var file in OutputFolder.EnumerateFiles()
.Where(f => f.FileName == tweaksPath))
{
try
{
var parser = new FileIniDataParser(new IniDataParser(config));
var data = parser.ReadFile((string)file);
bool modified = false;
if (data.Sections["Render"] != null)
{
if (data.Sections["Render"]["Resolution"] != null)
{
data.Sections["Render"]["Resolution"] =
$"{SystemParameters.ScreenWidth.ToString(CultureInfo.CurrentCulture)}x{SystemParameters.ScreenHeight.ToString(CultureInfo.CurrentCulture)}";
modified = true;
}
}
if (modified)
parser.WriteFile((string)file, data);
}
catch (Exception)
{
Utils.Log($"Skipping screen size remap for {file} due to parse error.");
}
}
}
private async Task WriteRemappedFile(RemappedInlineFile directive)

View File

@ -168,6 +168,10 @@ namespace Wabbajack.Test
await utils.VerifyInstalledFile(mod, @"Data\scripts\deleted.pex");
await utils.VerifyInstalledFile(mod, @"Data\scripts\modified.pex");
var nodeletefile = utils.InstallPath.Combine("mods", "[NoDelete] Mod I added", "somefile.esp");
nodeletefile.Parent.CreateDirectory();
await nodeletefile.WriteAllTextAsync("some data");
var unchangedPath = utils.PathOfInstalledFile(mod, @"Data\scripts\unchanged.pex");
var deletedPath = utils.PathOfInstalledFile(mod, @"Data\scripts\deleted.pex");
var modifiedPath = utils.PathOfInstalledFile(mod, @"Data\scripts\modified.pex");
@ -200,6 +204,8 @@ namespace Wabbajack.Test
Assert.NotEqual(modifiedModified, modifiedPath.LastModified);
Assert.False(extraPath.Exists);
Assert.False(extraFolder.Exists);
Assert.True(nodeletefile.Exists, "File should exist because it's in a [NoDelete] folder");
}
[Fact]
@ -248,6 +254,18 @@ namespace Wabbajack.Test
"iSize W=100",
"[MEMORY]",
"VideoMemorySizeMb=22");
await utils.SourcePath.Combine("profiles", profile, "oblivion.ini").WriteAllLinesAsync(
// Beth inis are messy, let's make ours just as messy to catch some parse failures
"STestFile=",
"[Display]",
"foo=4",
"iSize H=50",
"iSize W=100");
await utils.SourcePath.Combine("SseDisplayTweaks.ini").WriteAllLinesAsync(
"[Render]",
"Resolution=100x100");
var modlist = await CompileAndInstall(profile);
@ -258,6 +276,13 @@ namespace Wabbajack.Test
Assert.Equal(sysinfo.ScreenHeight.ToString(), ini?.Display?["iSize H"]);
Assert.Equal(sysinfo.ScreenWidth.ToString(), ini?.Display?["iSize W"]);
Assert.Equal(sysinfo.EnbLEVRAMSize.ToString(), ini?.MEMORY?["VideoMemorySizeMb"]);
var ini2 = utils.InstallPath.Combine("profiles", profile, "Oblivion.ini").LoadIniFile();
Assert.Equal(sysinfo.ScreenHeight.ToString(), ini2?.Display?["iSize H"]);
Assert.Equal(sysinfo.ScreenWidth.ToString(), ini2?.Display?["iSize W"]);
var ini3 = utils.InstallPath.Combine("sseDisplayTweaks.ini").LoadIniFile();
Assert.Equal($"{sysinfo.ScreenWidth}x{sysinfo.ScreenHeight}", ini3?.Render?.Resolution);
}
[Fact]