mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
MO2Installer will create output folders for executables if they dont exist
This commit is contained in:
parent
e762ec5c9a
commit
34ec97f1a4
@ -36,18 +36,18 @@ namespace Wabbajack.Common
|
||||
}
|
||||
}
|
||||
|
||||
internal class SectionData : DynamicObject
|
||||
public class SectionData : DynamicObject
|
||||
{
|
||||
private readonly KeyDataCollection _coll;
|
||||
public KeyDataCollection Coll { get; }
|
||||
|
||||
public SectionData(KeyDataCollection coll)
|
||||
{
|
||||
_coll = coll;
|
||||
Coll = coll;
|
||||
}
|
||||
|
||||
public override bool TryGetMember(GetMemberBinder binder, out object result)
|
||||
{
|
||||
result = _coll[binder.Name];
|
||||
result = Coll[binder.Name];
|
||||
if (result is string s) result = Interpret(s);
|
||||
return true;
|
||||
}
|
||||
@ -108,7 +108,7 @@ namespace Wabbajack.Common
|
||||
return false;
|
||||
}
|
||||
|
||||
result = _coll[(string) indexes[0]];
|
||||
result = Coll[(string) indexes[0]];
|
||||
if (result is string s) result = Regex.Unescape(s.Trim('"'));
|
||||
return true;
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ using Wabbajack.Lib.Validation;
|
||||
using Directory = Alphaleonis.Win32.Filesystem.Directory;
|
||||
using File = Alphaleonis.Win32.Filesystem.File;
|
||||
using Path = Alphaleonis.Win32.Filesystem.Path;
|
||||
using SectionData = Wabbajack.Common.SectionData;
|
||||
|
||||
namespace Wabbajack.Lib
|
||||
{
|
||||
@ -45,7 +46,7 @@ namespace Wabbajack.Lib
|
||||
if (cancel.IsCancellationRequested) return false;
|
||||
var metric = Metrics.Send("begin_install", ModList.Name);
|
||||
|
||||
ConfigureProcessor(19, ConstructDynamicNumThreads(await RecommendQueueSize()));
|
||||
ConfigureProcessor(20, ConstructDynamicNumThreads(await RecommendQueueSize()));
|
||||
var game = ModList.GameType.MetaData();
|
||||
|
||||
if (GameFolder == null)
|
||||
@ -139,6 +140,9 @@ namespace Wabbajack.Lib
|
||||
UpdateTracker.NextStep("Set MO2 into portable");
|
||||
ForcePortable();
|
||||
|
||||
UpdateTracker.NextStep("Create Empty Output Mods");
|
||||
CreateOutputMods();
|
||||
|
||||
UpdateTracker.NextStep("Updating System-specific ini settings");
|
||||
SetScreenSizeInPrefs();
|
||||
|
||||
@ -148,6 +152,38 @@ namespace Wabbajack.Lib
|
||||
return true;
|
||||
}
|
||||
|
||||
private void CreateOutputMods()
|
||||
{
|
||||
Directory.EnumerateFiles(Path.Combine(OutputFolder, "profiles"), "settings.ini", DirectoryEnumerationOptions.Recursive).Do(f =>
|
||||
{
|
||||
var ini = f.LoadIniFile();
|
||||
if (ini == null)
|
||||
{
|
||||
Utils.Log($"settings.ini is null for {f}, skipping");
|
||||
return;
|
||||
}
|
||||
|
||||
var overwrites = ini.custom_overwrites;
|
||||
if (overwrites == null)
|
||||
{
|
||||
Utils.Log("No custom overwrites found, skipping");
|
||||
return;
|
||||
}
|
||||
|
||||
if (overwrites is SectionData data)
|
||||
{
|
||||
data.Coll.Do(keyData =>
|
||||
{
|
||||
var v = keyData.Value;
|
||||
var mod = Path.Combine(OutputFolder, "mods", v);
|
||||
|
||||
if (!Directory.Exists(mod))
|
||||
Directory.CreateDirectory(mod);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void ForcePortable()
|
||||
{
|
||||
var path = Path.Combine(OutputFolder, "portable.txt");
|
||||
|
Loading…
Reference in New Issue
Block a user