diff --git a/CHANGELOG.md b/CHANGELOG.md index 53c3b913..cd3b002f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ### Changelog +#### Version - next +* Added `WABBAJACK_ALWAYS_DISABLE` flag (see Readme for more info) +* Modlist can't be installed if the current Wabbajack Version is smaller than the Version used during Compilation of the Modlist + #### Version - 2.2.0.0 - 8/7/2020 * Can now use NTFS XPRESS16 compression to reduce install sizes (optional in the settings panel) * Better valid directory detection during install diff --git a/Wabbajack.Common/Consts.cs b/Wabbajack.Common/Consts.cs index e98bec9b..de6e9dbd 100644 --- a/Wabbajack.Common/Consts.cs +++ b/Wabbajack.Common/Consts.cs @@ -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"; diff --git a/Wabbajack.Lib/ACompiler.cs b/Wabbajack.Lib/ACompiler.cs index 705dabaf..6667f101 100644 --- a/Wabbajack.Lib/ACompiler.cs +++ b/Wabbajack.Lib/ACompiler.cs @@ -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) diff --git a/Wabbajack/View Models/Installers/InstallerVM.cs b/Wabbajack/View Models/Installers/InstallerVM.cs index 9d4f1c34..fcf2c997 100644 --- a/Wabbajack/View Models/Installers/InstallerVM.cs +++ b/Wabbajack/View Models/Installers/InstallerVM.cs @@ -210,8 +210,10 @@ namespace Wabbajack ModListLocation.AdditionalError = this.WhenAny(x => x.ModList) .Select(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; }); diff --git a/Wabbajack/View Models/MainWindowVM.cs b/Wabbajack/View Models/MainWindowVM.cs index ac78cc79..7228dc89 100644 --- a/Wabbajack/View Models/MainWindowVM.cs +++ b/Wabbajack/View Models/MainWindowVM.cs @@ -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}");