Merge pull request #112 from erri120/build-version

Include WJ build version in the Modlist
This commit is contained in:
Timothy Baldridge 2019-10-23 14:26:59 -06:00 committed by GitHub
commit 4dc6ed49b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 40 additions and 5 deletions

View File

@ -7,6 +7,7 @@ using System.Diagnostics;
using System.IO; using System.IO;
using System.IO.Compression; using System.IO.Compression;
using System.Linq; using System.Linq;
using System.Reflection;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using VFS; using VFS;
@ -33,6 +34,7 @@ namespace Wabbajack.Lib
public string MO2Profile; public string MO2Profile;
public string ModListName, ModListAuthor, ModListDescription, ModListWebsite, ModListImage, ModListReadme; public string ModListName, ModListAuthor, ModListDescription, ModListWebsite, ModListImage, ModListReadme;
public string WabbajackVersion;
public Compiler(string mo2_folder) public Compiler(string mo2_folder)
{ {
@ -274,6 +276,7 @@ namespace Wabbajack.Lib
ModList = new ModList ModList = new ModList
{ {
GameType = GameRegistry.Games.Values.First(f => f.MO2Name == MO2Ini.General.gameName).Game, GameType = GameRegistry.Games.Values.First(f => f.MO2Name == MO2Ini.General.gameName).Game,
WabbajackVersion = WabbajackVersion,
Archives = SelectedArchives, Archives = SelectedArchives,
Directives = InstallDirectives, Directives = InstallDirectives,
Name = ModListName ?? MO2Profile, Name = ModListName ?? MO2Profile,

View File

@ -1,6 +1,7 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using Compression.BSA; using Compression.BSA;
using VFS; using VFS;
using Wabbajack.Common; using Wabbajack.Common;
@ -46,6 +47,11 @@ namespace Wabbajack.Lib
/// </summary> /// </summary>
public Game GameType; public Game GameType;
/// <summary>
/// The build version of Wabbajack used when compiling the Modlist
/// </summary>
public string WabbajackVersion;
/// <summary> /// <summary>
/// Install directives /// Install directives
/// </summary> /// </summary>

View File

@ -47,6 +47,7 @@ namespace Wabbajack.Lib
public void Build(Compiler c, ModList lst) public void Build(Compiler c, ModList lst)
{ {
Text($"### {lst.Name} by {lst.Author} - Installation Summary"); Text($"### {lst.Name} by {lst.Author} - Installation Summary");
Text($"Build with Wabbajack Version {lst.WabbajackVersion}");
Text(lst.Description); Text(lst.Description);
Text($"#### Website:"); Text($"#### Website:");
NoWrapText($"[{lst.Website}]({lst.Website})"); NoWrapText($"[{lst.Website}]({lst.Website})");

View File

@ -34,6 +34,8 @@ namespace Wabbajack
{ {
public SlideShow Slideshow { get; } public SlideShow Slideshow { get; }
public readonly string WabbajackVersion = FileVersionInfo.GetVersionInfo(Assembly.GetEntryAssembly().Location).FileVersion;
private string _mo2Folder; private string _mo2Folder;
public readonly BitmapImage _noneImage = UIUtils.BitmapImageFromResource("Wabbajack.UI.none.jpg"); public readonly BitmapImage _noneImage = UIUtils.BitmapImageFromResource("Wabbajack.UI.none.jpg");
@ -293,6 +295,28 @@ namespace Wabbajack
HTMLReport = this.ModList.ReportHTML; HTMLReport = this.ModList.ReportHTML;
Location = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); Location = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
var currentWJVersion = new Version(WabbajackVersion);
var modlistWJVersion = new Version(modlist.WabbajackVersion);
if (currentWJVersion > modlistWJVersion)
{
MessageBox.Show(
"The selected Modlist was build with an earlier version of Wabbajack. " +
$"Current Version: {WabbajackVersion}, " +
$"Version used to build the Modlist: {modlist.WabbajackVersion}",
"Information",
MessageBoxButton.OK);
}
else if(currentWJVersion < modlistWJVersion)
{
MessageBox.Show(
"The selected Modlist was build with a newer version of Wabbajack. " +
$"Current Version: {WabbajackVersion}, " +
$"Version used to build the Modlist: {modlist.WabbajackVersion}",
"Information",
MessageBoxButton.OK);
}
this.Slideshow.SlideShowElements = modlist.Archives this.Slideshow.SlideShowElements = modlist.Archives
.Select(m => m.State) .Select(m => m.State)
.OfType<NexusDownloader.State>() .OfType<NexusDownloader.State>()
@ -350,7 +374,8 @@ namespace Wabbajack
ModListDescription = ChangedProperties ? this.Slideshow.Summary : null, ModListDescription = ChangedProperties ? this.Slideshow.Summary : null,
ModListImage = ChangedProperties ? newImagePath : null, ModListImage = ChangedProperties ? newImagePath : null,
ModListWebsite = ChangedProperties ? this.Slideshow.NexusSiteURL : null, ModListWebsite = ChangedProperties ? this.Slideshow.NexusSiteURL : null,
ModListReadme = ChangedProperties ? readmePath : null ModListReadme = ChangedProperties ? readmePath : null,
WabbajackVersion = WabbajackVersion
}; };
var th = new Thread(() => var th = new Thread(() =>
{ {

View File

@ -6,9 +6,9 @@ using System.Windows;
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("Wabbajack")] [assembly: AssemblyTitle("Wabbajack")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("An automated modlist installer for TES/Fallout games")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("Wabbajack")]
[assembly: AssemblyProduct("Wabbajack")] [assembly: AssemblyProduct("Wabbajack")]
[assembly: AssemblyCopyright("Copyright © 2019")] [assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
@ -49,5 +49,5 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.2.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.2.0")]