From 77275dd30b994538b0edbe5ec225237f02012f3e Mon Sep 17 00:00:00 2001 From: erri120 Date: Tue, 11 Aug 2020 14:31:58 +0200 Subject: [PATCH 1/2] Current Wabbajack must be newer than Wabbajack version of compiled Modlist --- Wabbajack.Common/Consts.cs | 2 ++ Wabbajack.Lib/ACompiler.cs | 4 ++++ Wabbajack/View Models/Installers/InstallerVM.cs | 6 ++++-- Wabbajack/View Models/MainWindowVM.cs | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) 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}"); From 1ed3f15516e8f3b73f8faed7d45c297ed0bee1ae Mon Sep 17 00:00:00 2001 From: erri120 Date: Tue, 11 Aug 2020 14:33:13 +0200 Subject: [PATCH 2/2] Updated CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) 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