Fixed some stuff

This commit is contained in:
erri120 2019-11-04 13:30:02 +01:00 committed by Timothy Baldridge
parent 45ba7d4bce
commit 8d650fcbd9
2 changed files with 74 additions and 46 deletions

View File

@ -100,15 +100,18 @@ namespace Wabbajack.Lib
IEnumerable<RawSourceFile> game_files = Directory.EnumerateFiles(GamePath, "*", SearchOption.AllDirectories)
.Where(p => p.FileExists())
.Select(p => new RawSourceFile(VFS.Lookup(p))
{ Path = Alphaleonis.Win32.Filesystem.Path.Combine(Consts.GameFolderFilesDir, p.RelativeTo(GamePath)) });
{ Path = Path.Combine(Consts.GameFolderFilesDir, p.RelativeTo(GamePath)) });
Info("Indexing Archives");
IndexedArchives = Directory.EnumerateFiles(DownloadsFolder)
//.Where(f => File.Exists(f+".meta"))
.Where(File.Exists)
.Select(f => new IndexedArchive
{
File = VFS.Lookup(f),
Name = Path.GetFileName(f)
Name = Path.GetFileName(f),
//IniData = (f+"meta").LoadIniFile(),
//Meta = File.ReadAllText(f+".meta")
})
.ToList();
@ -131,7 +134,7 @@ namespace Wabbajack.Lib
.Where(fs => fs.Count() > 1)
.Select(fs =>
{
Utils.Log($"Duplicate files installed to {fs.Key} from : {String.Join(", ", fs.Select(f => f.AbsolutePath))}");
Utils.Log($"Duplicate files installed to {fs.Key} from : {string.Join(", ", fs.Select(f => f.AbsolutePath))}");
return fs;
}).ToList();
@ -205,7 +208,7 @@ namespace Wabbajack.Lib
using (var za = new ZipArchive(fs, ZipArchiveMode.Create))
{
Directory.EnumerateFiles(ModListOutputFolder, "*.*")
.DoProgress("Compressing Modlist",
.DoProgress("Compressing ModList",
f =>
{
var ze = za.CreateEntry(Path.GetFileName(f));
@ -218,7 +221,7 @@ namespace Wabbajack.Lib
}
}
Utils.Log("Removing ModList staging folder");
Directory.Delete(ModListOutputFolder, true);
//Directory.Delete(ModListOutputFolder, true);
}
private void GatherArchives()
@ -288,12 +291,13 @@ namespace Wabbajack.Lib
{
//new IncludePropertyFiles(this),
new IgnoreGameFiles(this),
new IgnoreStartsWith(this, Path.Combine(Consts.GameFolderFilesDir, "Data")),
new IgnoreStartsWith(this, Path.Combine(Consts.GameFolderFilesDir, "Papyrus Compiler")),
new IgnoreStartsWith(this, Path.Combine(Consts.GameFolderFilesDir, "Skyrim")),
new IgnoreRegex(this, Consts.GameFolderFilesDir + "\\\\.*\\.bsa"),
new IgnoreGameFiles(this),
new IncludeRegex(this, @".*\.zip?$"),
//new IncludeRegex(this, "*.zip"),
//new IgnoreStartsWith(this, Path.Combine(Consts.GameFolderFilesDir, "Data")),
//new IgnoreStartsWith(this, Path.Combine(Consts.GameFolderFilesDir, "Papyrus Compiler")),
//new IgnoreStartsWith(this, Path.Combine(Consts.GameFolderFilesDir, "Skyrim")),
//new IgnoreRegex(this, Consts.GameFolderFilesDir + "\\\\.*\\.bsa"),
new DirectMatch(this),

View File

@ -196,47 +196,71 @@ namespace Wabbajack
private async Task ExecuteBegin()
{
Compiler compiler;
try
if (true)
{
compiler = new Compiler(this.Mo2Folder)
var compiler = new VortexCompiler("darkestdungeon", "S:\\SteamLibrary\\steamapps\\common\\DarkestDungeon");
await Task.Run(() =>
{
MO2Profile = this.MOProfile,
ModListName = this.ModListName,
ModListAuthor = this.AuthorText,
ModListDescription = this.Description,
ModListImage = this.ImagePath.TargetPath,
ModListWebsite = this.Website,
ModListReadme = this.ReadMeText.TargetPath,
};
}
catch (Exception ex)
{
while (ex.InnerException != null) ex = ex.InnerException;
Utils.Log($"Compiler error: {ex.ExceptionToString()}");
return;
}
await Task.Run(() =>
{
Compiling = true;
try
{
compiler.Compile();
if (compiler.ModList?.ReportHTML != null)
UIReady = false;
try
{
this.HTMLReport = compiler.ModList.ReportHTML;
compiler.Compile();
}
}
catch (Exception ex)
catch (Exception ex)
{
while (ex.InnerException != null) ex = ex.InnerException;
this.Log().Warn(ex, "Can't continue");
}
finally
{
UIReady = true;
}
});
}else{
if (this.Mo2Folder != null)
{
while (ex.InnerException != null) ex = ex.InnerException;
Utils.Log($"Compiler error: {ex.ExceptionToString()}");
Compiler compiler;
try {
compiler = new Compiler(this.Mo2Folder)
{
MO2Profile = this.MOProfile,
ModListName = this.ModListName,
ModListAuthor = this.AuthorText,
ModListDescription = this.Description,
ModListImage = this.ImagePath.TargetPath,
ModListWebsite = this.Website,
ModListReadme = this.ReadMeText.TargetPath,
};
}
catch (Exception ex)
{
while (ex.InnerException != null) ex = ex.InnerException;
Utils.Log($"Compiler error: {ex.ExceptionToString()}");
return;
}
await Task.Run(() =>
{
Compiling = true;
try
{
compiler.Compile();
if (compiler.ModList?.ReportHTML != null)
{
this.HTMLReport = compiler.ModList.ReportHTML;
}
}
catch (Exception ex)
{
while (ex.InnerException != null) ex = ex.InnerException;
Utils.Log($"Compiler error: {ex.ExceptionToString()}");
}
finally
{
Compiling = false;
}
});
}
finally
{
Compiling = false;
}
});
}
}
}
}