Merge pull request #362 from erri120/mo2-force-portable

Create portable.txt after installation in MO2 dir
This commit is contained in:
Timothy Baldridge 2020-01-06 15:18:59 -08:00 committed by GitHub
commit 3cdb9dd37a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 2 deletions

View File

@ -536,7 +536,8 @@ namespace Wabbajack.Lib
new IgnoreEndsWith(this, "HavokBehaviorPostProcess.exe"),
// Theme file MO2 downloads somehow
new IgnoreEndsWith(this, "splash.png"),
// File to force MO2 into portable mode
new IgnoreEndsWith(this, "portable.txt"),
new IgnoreEndsWith(this, ".bin"),
new IgnoreEndsWith(this, ".refcache"),

View File

@ -44,7 +44,7 @@ namespace Wabbajack.Lib
if (cancel.IsCancellationRequested) return false;
var metric = Metrics.Send("begin_install", ModList.Name);
ConfigureProcessor(18, await RecommendQueueSize());
ConfigureProcessor(19, await RecommendQueueSize());
var game = ModList.GameType.MetaData();
if (GameFolder == null)
@ -135,6 +135,9 @@ namespace Wabbajack.Lib
UpdateTracker.NextStep("Generating Merges");
await zEditIntegration.GenerateMerges(this);
UpdateTracker.NextStep("Set MO2 into portable");
ForcePortable();
UpdateTracker.NextStep("Updating System-specific ini settings");
SetScreenSizeInPrefs();
@ -144,6 +147,20 @@ namespace Wabbajack.Lib
return true;
}
private void ForcePortable()
{
var path = Path.Combine(OutputFolder, "portable.txt");
if (File.Exists(path)) return;
try
{
File.WriteAllText(path, "Created by Wabbajack");
}
catch (Exception e)
{
Utils.Error(e, $"Could not create portable.txt in {OutputFolder}");
}
}
private async Task InstallIncludedDownloadMetas()
{