mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
AInstaller ctor parameters made more picky for required input
This commit is contained in:
parent
57c421967d
commit
5bb291a310
@ -18,15 +18,23 @@ namespace Wabbajack.Lib
|
||||
{
|
||||
public bool IgnoreMissingFiles { get; internal set; } = false;
|
||||
|
||||
public string OutputFolder { get; set; }
|
||||
public string DownloadFolder { get; set; }
|
||||
public string OutputFolder { get; private set; }
|
||||
public string DownloadFolder { get; private set; }
|
||||
|
||||
public ModManager ModManager;
|
||||
public abstract ModManager ModManager { get; }
|
||||
|
||||
public string ModListArchive { get; internal set; }
|
||||
public ModList ModList { get; internal set; }
|
||||
public string ModListArchive { get; private set; }
|
||||
public ModList ModList { get; private set; }
|
||||
public Dictionary<string, string> HashedArchives { get; set; }
|
||||
|
||||
public AInstaller(string archive, ModList modList, string outputFolder, string downloadFolder)
|
||||
{
|
||||
ModList = modList;
|
||||
ModListArchive = archive;
|
||||
OutputFolder = outputFolder;
|
||||
DownloadFolder = downloadFolder;
|
||||
}
|
||||
|
||||
public void Info(string msg)
|
||||
{
|
||||
Utils.Log(msg);
|
||||
|
@ -16,18 +16,20 @@ namespace Wabbajack.Lib
|
||||
public class MO2Installer : AInstaller
|
||||
{
|
||||
public bool WarnOnOverwrite { get; set; } = true;
|
||||
|
||||
public MO2Installer(string archive, ModList modList, string outputFolder)
|
||||
{
|
||||
ModManager = ModManager.MO2;
|
||||
ModListArchive = archive;
|
||||
OutputFolder = outputFolder;
|
||||
DownloadFolder = Path.Combine(OutputFolder, "downloads");
|
||||
ModList = modList;
|
||||
}
|
||||
|
||||
public override ModManager ModManager => ModManager.MO2;
|
||||
|
||||
public string GameFolder { get; set; }
|
||||
|
||||
public MO2Installer(string archive, ModList modList, string outputFolder, string downloadFolder)
|
||||
: base(
|
||||
archive: archive,
|
||||
modList: modList,
|
||||
outputFolder: outputFolder,
|
||||
downloadFolder: downloadFolder)
|
||||
{
|
||||
}
|
||||
|
||||
protected override bool _Begin()
|
||||
{
|
||||
ConfigureProcessor(17, RecommendQueueSize());
|
||||
|
@ -10,14 +10,19 @@ namespace Wabbajack.Lib
|
||||
{
|
||||
public GameMetaData GameInfo { get; internal set; }
|
||||
|
||||
public VortexInstaller(string archive, ModList modList)
|
||||
{
|
||||
ModManager = ModManager.Vortex;
|
||||
ModListArchive = archive;
|
||||
ModList = modList;
|
||||
public override ModManager ModManager => ModManager.Vortex;
|
||||
|
||||
public VortexInstaller(string archive, ModList modList, string outputFolder, string downloadFolder)
|
||||
: base(
|
||||
archive: archive,
|
||||
modList: modList,
|
||||
outputFolder: outputFolder,
|
||||
downloadFolder: downloadFolder)
|
||||
{
|
||||
#if DEBUG
|
||||
// TODO: only for testing
|
||||
IgnoreMissingFiles = true;
|
||||
#endif
|
||||
|
||||
GameInfo = GameRegistry.Games[ModList.GameType];
|
||||
}
|
||||
|
@ -49,9 +49,12 @@ namespace Wabbajack.Test
|
||||
protected void Install(MO2Compiler compiler)
|
||||
{
|
||||
var modlist = AInstaller.LoadFromFile(compiler.ModListOutputFile);
|
||||
var installer = new MO2Installer(compiler.ModListOutputFile, modlist, utils.InstallFolder);
|
||||
var installer = new MO2Installer(
|
||||
archive: compiler.ModListOutputFile,
|
||||
modList: modlist,
|
||||
outputFolder: utils.InstallFolder,
|
||||
downloadFolder: utils.DownloadsFolder);
|
||||
installer.WarnOnOverwrite = false;
|
||||
installer.DownloadFolder = utils.DownloadsFolder;
|
||||
installer.GameFolder = utils.GameFolder;
|
||||
installer.Begin().Wait();
|
||||
}
|
||||
|
@ -62,9 +62,12 @@ namespace Wabbajack.Test
|
||||
protected void Install(VortexCompiler vortexCompiler)
|
||||
{
|
||||
var modList = AInstaller.LoadFromFile(vortexCompiler.ModListOutputFile);
|
||||
var installer = new MO2Installer(vortexCompiler.ModListOutputFile, modList, utils.InstallFolder)
|
||||
var installer = new MO2Installer(
|
||||
archive: vortexCompiler.ModListOutputFile,
|
||||
modList: modList,
|
||||
outputFolder: utils.InstallFolder,
|
||||
downloadFolder: utils.DownloadsFolder)
|
||||
{
|
||||
DownloadFolder = utils.DownloadsFolder,
|
||||
GameFolder = utils.GameFolder,
|
||||
};
|
||||
installer.Begin().Wait();
|
||||
|
@ -147,8 +147,11 @@ namespace Wabbajack.Test
|
||||
private void Install(MO2Compiler compiler)
|
||||
{
|
||||
var modlist = AInstaller.LoadFromFile(compiler.ModListOutputFile);
|
||||
var installer = new MO2Installer(compiler.ModListOutputFile, modlist, utils.InstallFolder);
|
||||
installer.DownloadFolder = utils.DownloadsFolder;
|
||||
var installer = new MO2Installer(
|
||||
archive: compiler.ModListOutputFile,
|
||||
modList: modlist,
|
||||
outputFolder: utils.InstallFolder,
|
||||
downloadFolder: utils.DownloadsFolder);
|
||||
installer.GameFolder = utils.GameFolder;
|
||||
installer.Begin().Wait();
|
||||
}
|
||||
|
@ -328,10 +328,11 @@ namespace Wabbajack
|
||||
|
||||
try
|
||||
{
|
||||
installer = new MO2Installer(ModListPath.TargetPath, ModList.SourceModList, Location.TargetPath)
|
||||
{
|
||||
DownloadFolder = DownloadLocation.TargetPath
|
||||
};
|
||||
installer = new MO2Installer(
|
||||
archive: ModListPath.TargetPath,
|
||||
modList: ModList.SourceModList,
|
||||
outputFolder: Location.TargetPath,
|
||||
downloadFolder: DownloadLocation.TargetPath);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user