Current Wabbajack must be newer than Wabbajack version of compiled Modlist

This commit is contained in:
erri120 2020-08-11 14:31:58 +02:00
parent c5e11a2564
commit 77275dd30b
No known key found for this signature in database
GPG Key ID: A8C0A18D8D4D3135
4 changed files with 11 additions and 2 deletions

View File

@ -11,6 +11,8 @@ namespace Wabbajack.Common
{
public static class Consts
{
public static Version? CurrentWabbajackVersion { get; set; }
public static bool TestMode { get; set; } = false;
public static RelativePath GameFolderFilesDir = (RelativePath)"Game Folder Files";

View File

@ -1,10 +1,12 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Reactive.Subjects;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Wabbajack.Common;
@ -54,6 +56,8 @@ namespace Wabbajack.Lib
public ACompiler(int steps)
: base(steps)
{
//set in MainWindowVM
WabbajackVersion = Consts.CurrentWabbajackVersion;
}
public static void Info(string msg)

View File

@ -210,8 +210,10 @@ namespace Wabbajack
ModListLocation.AdditionalError = this.WhenAny(x => x.ModList)
.Select<ModListVM, IErrorResponse>(modList =>
{
if (modList == null) return ErrorResponse.Fail("ModList path resulted in a null object.");
if (modList.Error != null) return ErrorResponse.Fail("ModList is corrupt", modList.Error);
if (modList == null) return ErrorResponse.Fail("Modlist path resulted in a null object.");
if (modList.Error != null) return ErrorResponse.Fail("Modlist is corrupt", modList.Error);
if (modList.Version != null && modList.Version > Consts.CurrentWabbajackVersion)
return ErrorResponse.Fail("The Modlist you are trying to install was made using a newer Version of Wabbajack. Please update Wabbajack before installing!");
return ErrorResponse.Success;
});

View File

@ -120,6 +120,7 @@ namespace Wabbajack
{
var assembly = Assembly.GetExecutingAssembly();
var fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
Consts.CurrentWabbajackVersion = Version.Parse(fvi.FileVersion);
VersionDisplay = $"v{fvi.FileVersion}";
Utils.Log($"Wabbajack Version: {fvi.FileVersion}");