diff --git a/Wabbajack/View Models/MainWindowVM.cs b/Wabbajack/View Models/MainWindowVM.cs index ac3a8f5e..0f70c6a4 100644 --- a/Wabbajack/View Models/MainWindowVM.cs +++ b/Wabbajack/View Models/MainWindowVM.cs @@ -3,11 +3,13 @@ using DynamicData.Binding; using ReactiveUI; using ReactiveUI.Fody.Helpers; using System; +using System.Diagnostics; using System.Linq; using System.Reactive.Disposables; using System.Reactive.Linq; using System.Threading.Tasks; using System.Windows; +using System.Windows.Input; using System.Windows.Threading; using Wabbajack.Common; using Wabbajack.Common.StatusFeed; @@ -38,6 +40,9 @@ namespace Wabbajack public readonly UserInterventionHandlers UserInterventionHandlers; public Dispatcher ViewDispatcher { get; set; } + public ICommand CopyVersionCommand { get; } + public string VersionDisplay { get; } + public MainWindowVM(MainWindow mainWindow, MainSettings settings) { MainWindow = mainWindow; @@ -79,6 +84,22 @@ namespace Wabbajack // Start on mode selection ActivePane = ModeSelectionVM; } + + try + { + System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly(); + FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location); + VersionDisplay = $"v{fvi.FileVersion}"; + } + catch (Exception ex) + { + Utils.Error(ex); + VersionDisplay = "ERROR"; + } + CopyVersionCommand = ReactiveCommand.Create(() => + { + Clipboard.SetText($"Wabbajack {VersionDisplay}\n{ThisAssembly.Git.Sha}"); + }); } private static bool IsStartingFromModlist(out string modlistPath) diff --git a/Wabbajack/Views/MainWindow.xaml b/Wabbajack/Views/MainWindow.xaml index 65566907..29531bcb 100644 --- a/Wabbajack/Views/MainWindow.xaml +++ b/Wabbajack/Views/MainWindow.xaml @@ -38,4 +38,16 @@ + + + + + +