diff --git a/Wabbajack.Lib/CompilationSteps/IncludeVortexDeployment.cs b/Wabbajack.Lib/CompilationSteps/IncludeVortexDeployment.cs index 2650a7c7..0269a07a 100644 --- a/Wabbajack.Lib/CompilationSteps/IncludeVortexDeployment.cs +++ b/Wabbajack.Lib/CompilationSteps/IncludeVortexDeployment.cs @@ -1,5 +1,8 @@ -using System.IO; +using System.Collections.Generic; +using System.IO; +using System.Linq; using System.Threading.Tasks; +using Wabbajack.Common; namespace Wabbajack.Lib.CompilationSteps { @@ -11,10 +14,21 @@ namespace Wabbajack.Lib.CompilationSteps public override async ValueTask Run(RawSourceFile source) { - if (!source.Path.EndsWith("vortex.deployment.msgpack") && - !source.Path.EndsWith("\\vortex.deployment.json") && Path.GetExtension(source.Path) != ".meta") return null; + var l = new List {"vortex.deployment.msgpack", "vortex.deployment.json"}; + if (!l.Any(a => source.Path.Contains(a))) return null; var inline = source.EvolveTo(); inline.SourceDataID = _compiler.IncludeFile(File.ReadAllBytes(source.AbsolutePath)); + if (!source.Path.Contains("vortex.deployment.json")) + return inline; + + var path = source.Path; + if (!path.StartsWith(Consts.GameFolderFilesDir)) + return inline; + + path = path.Substring(Consts.GameFolderFilesDir.Length + 1); + path = $"{Consts.ManualGameFilesDir}\\{path}"; + inline.To = path; + return inline; } diff --git a/Wabbajack.Lib/VortexCompiler.cs b/Wabbajack.Lib/VortexCompiler.cs index fdc5c16e..17e4642d 100644 --- a/Wabbajack.Lib/VortexCompiler.cs +++ b/Wabbajack.Lib/VortexCompiler.cs @@ -116,7 +116,7 @@ namespace Wabbajack.Lib UpdateTracker.NextStep("Finding Install Files"); var vortexStagingFiles = Directory.EnumerateFiles(StagingFolder, "*", SearchOption.AllDirectories) - .Where(p => p.FileExists() && p != StagingMarkerName) + .Where(p => p.FileExists() && p != StagingMarkerName && !p.Contains(Consts.ManualGameFilesDir)) .Select(p => new RawSourceFile(VFS.Index.ByRootPath[p]) {Path = p.RelativeTo(StagingFolder)}); @@ -470,12 +470,12 @@ namespace Wabbajack.Lib return new List { new IncludePropertyFiles(this), + new IncludeVortexDeployment(this), new IncludeSteamWorkshopItems(this, _steamGame), _hasSteamWorkshopItems ? new IncludeRegex(this, "^steamWorkshopItem_\\d*\\.meta$") : null, new IgnoreDisabledVortexMods(this), - new IncludeVortexDeployment(this), new IgnoreVortex(this), new IgnoreRegex(this, $"^*{StagingMarkerName}$"), diff --git a/Wabbajack.Lib/VortexInstaller.cs b/Wabbajack.Lib/VortexInstaller.cs index 013ddef0..438bd44a 100644 --- a/Wabbajack.Lib/VortexInstaller.cs +++ b/Wabbajack.Lib/VortexInstaller.cs @@ -132,14 +132,14 @@ namespace Wabbajack.Lib var dirInfo = new DirectoryInfo(dir); dirInfo.GetDirectories("*", SearchOption.AllDirectories).Do(d => { - var destPath = d.FullName.Replace(dir, gameFolder); + var destPath = d.FullName.Replace(manualFilesDir, gameFolder); Status($"Creating directory {destPath}"); Directory.CreateDirectory(destPath); }); dirInfo.GetFiles("*", SearchOption.AllDirectories).Do(f => { - var destPath = f.FullName.Replace(dir, gameFolder); + var destPath = f.FullName.Replace(manualFilesDir, gameFolder); Status($"Copying file {f.FullName} to {destPath}"); try { @@ -207,7 +207,7 @@ namespace Wabbajack.Lib if (directive.To.EndsWith(".meta")) return; - Status($"Writing included file {directive.To}"); + Info($"Writing included file {directive.To}"); var outPath = Path.Combine(OutputFolder, directive.To); if(File.Exists(outPath)) File.Delete(outPath); File.WriteAllBytes(outPath, LoadBytesFromPath(directive.SourceDataID));