Merge pull request #1023 from erri120/modlist-version-check

Modlist version check
This commit is contained in:
Timothy Baldridge 2020-08-11 12:52:14 -06:00 committed by GitHub
commit 32d635243a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 2 deletions

View File

@ -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

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}");