mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Missing ExtractLibs awaits
This commit is contained in:
@ -19,7 +19,7 @@ namespace Wabbajack.Lib.LibCefHelpers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// We bundle the cef libs inside the .exe, we need to extract them before loading any wpf code that requires them
|
/// We bundle the cef libs inside the .exe, we need to extract them before loading any wpf code that requires them
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void ExtractLibs()
|
public static async Task ExtractLibs()
|
||||||
{
|
{
|
||||||
if (File.Exists("cefglue.7z") && File.Exists("libcef.dll")) return;
|
if (File.Exists("cefglue.7z") && File.Exists("libcef.dll")) return;
|
||||||
|
|
||||||
@ -30,8 +30,9 @@ namespace Wabbajack.Lib.LibCefHelpers
|
|||||||
Utils.Log("Extracting libCef files");
|
Utils.Log("Extracting libCef files");
|
||||||
}
|
}
|
||||||
using (var wq = new WorkQueue(1))
|
using (var wq = new WorkQueue(1))
|
||||||
FileExtractor.ExtractAll(wq, "cefglue.7z", ".");
|
{
|
||||||
|
await FileExtractor.ExtractAll(wq, "cefglue.7z", ".");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public static HttpClient GetClient(IEnumerable<Cookie> cookies, string referer)
|
public static HttpClient GetClient(IEnumerable<Cookie> cookies, string referer)
|
||||||
{
|
{
|
||||||
|
@ -13,9 +13,9 @@ namespace Wabbajack.Test
|
|||||||
protected TestUtils utils { get; set; }
|
protected TestUtils utils { get; set; }
|
||||||
|
|
||||||
[TestInitialize]
|
[TestInitialize]
|
||||||
public void TestInitialize()
|
public async Task TestInitialize()
|
||||||
{
|
{
|
||||||
Helpers.ExtractLibs();
|
await Helpers.ExtractLibs();
|
||||||
Consts.TestMode = true;
|
Consts.TestMode = true;
|
||||||
|
|
||||||
utils = new TestUtils();
|
utils = new TestUtils();
|
||||||
|
@ -24,9 +24,9 @@ namespace Wabbajack.Test
|
|||||||
public TestContext TestContext { get; set; }
|
public TestContext TestContext { get; set; }
|
||||||
|
|
||||||
[TestInitialize]
|
[TestInitialize]
|
||||||
public void Setup()
|
public async Task Setup()
|
||||||
{
|
{
|
||||||
Helpers.ExtractLibs();
|
await Helpers.ExtractLibs();
|
||||||
Utils.LogMessages.OfType<IInfo>().Subscribe(onNext: msg => TestContext.WriteLine(msg.ShortDescription));
|
Utils.LogMessages.OfType<IInfo>().Subscribe(onNext: msg => TestContext.WriteLine(msg.ShortDescription));
|
||||||
Utils.LogMessages.OfType<IUserIntervention>().Subscribe(msg =>
|
Utils.LogMessages.OfType<IUserIntervention>().Subscribe(msg =>
|
||||||
TestContext.WriteLine("ERROR: User intervetion required: " + msg.ShortDescription));
|
TestContext.WriteLine("ERROR: User intervetion required: " + msg.ShortDescription));
|
||||||
|
@ -4,7 +4,6 @@ using System.Reflection;
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using MahApps.Metro;
|
using MahApps.Metro;
|
||||||
using Wabbajack.Common;
|
using Wabbajack.Common;
|
||||||
using Wabbajack.Lib.LibCefHelpers;
|
|
||||||
|
|
||||||
namespace Wabbajack
|
namespace Wabbajack
|
||||||
{
|
{
|
||||||
@ -15,7 +14,7 @@ namespace Wabbajack
|
|||||||
{
|
{
|
||||||
public App()
|
public App()
|
||||||
{
|
{
|
||||||
Helpers.ExtractLibs();
|
// Do initialization in MainWindow ctor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using MahApps.Metro.Controls;
|
using MahApps.Metro.Controls;
|
||||||
using Wabbajack.Common;
|
using Wabbajack.Common;
|
||||||
|
using Wabbajack.Lib.LibCefHelpers;
|
||||||
using Application = System.Windows.Application;
|
using Application = System.Windows.Application;
|
||||||
using Utils = Wabbajack.Common.Utils;
|
using Utils = Wabbajack.Common.Utils;
|
||||||
|
|
||||||
@ -25,6 +27,12 @@ namespace Wabbajack
|
|||||||
Wabbajack.Common.Utils.Error(((Exception)e.ExceptionObject), "Uncaught error");
|
Wabbajack.Common.Utils.Error(((Exception)e.ExceptionObject), "Uncaught error");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Wabbajack.Common.Utils.Log($"Wabbajack Build - {ThisAssembly.Git.Sha}");
|
||||||
|
|
||||||
|
// Run some init tasks in background
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
await Helpers.ExtractLibs();
|
||||||
var appPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
|
var appPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -37,9 +45,7 @@ namespace Wabbajack
|
|||||||
{
|
{
|
||||||
Utils.Log($"ExtensionManager had an exception:\n{e}");
|
Utils.Log($"ExtensionManager had an exception:\n{e}");
|
||||||
}
|
}
|
||||||
|
}).FireAndForget();
|
||||||
|
|
||||||
Wabbajack.Common.Utils.Log($"Wabbajack Build - {ThisAssembly.Git.Sha}");
|
|
||||||
|
|
||||||
// Load settings
|
// Load settings
|
||||||
string[] args = Environment.GetCommandLineArgs();
|
string[] args = Environment.GetCommandLineArgs();
|
||||||
|
Reference in New Issue
Block a user