adding version to title and logs

This commit is contained in:
IsWaffle 2023-05-22 19:14:41 -04:00
parent 52a283ad37
commit 37c7457026
3 changed files with 16 additions and 2 deletions

View File

@ -9,6 +9,8 @@
<PackageIcon>icon.ico</PackageIcon> <PackageIcon>icon.ico</PackageIcon>
<ApplicationIcon>Assets\icon.ico</ApplicationIcon> <ApplicationIcon>Assets\icon.ico</ApplicationIcon>
<Configurations>Debug;Release;TEST</Configurations> <Configurations>Debug;Release;TEST</Configurations>
<AssemblyVersion>2.2</AssemblyVersion>
<FileVersion>2.2</FileVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -2,6 +2,7 @@
using ReactiveUI; using ReactiveUI;
using Serilog; using Serilog;
using System; using System;
using System.Reflection;
namespace SPTInstaller.ViewModels namespace SPTInstaller.ViewModels
{ {
@ -10,9 +11,20 @@ namespace SPTInstaller.ViewModels
public RoutingState Router { get; } = new RoutingState(); public RoutingState Router { get; } = new RoutingState();
public ViewModelActivator Activator { get; } = new ViewModelActivator(); public ViewModelActivator Activator { get; } = new ViewModelActivator();
private string _title;
public string Title
{
get => _title;
set => this.RaiseAndSetIfChanged(ref _title, value);
}
public MainWindowViewModel() public MainWindowViewModel()
{ {
Log.Information("========= LAUNCHER STARTED ========="); string? version = Assembly.GetExecutingAssembly().GetName()?.Version?.ToString();
Title = $"SPT Installer {"v" + version ?? "--unknown version--"}";
Log.Information($"========= {Title} Started =========");
Log.Information(Environment.OSVersion.VersionString); Log.Information(Environment.OSVersion.VersionString);
Router.Navigate.Execute(new PreChecksViewModel(this)); Router.Navigate.Execute(new PreChecksViewModel(this));

View File

@ -27,7 +27,7 @@
</Design.DataContext> </Design.DataContext>
<Grid RowDefinitions="AUTO,*"> <Grid RowDefinitions="AUTO,*">
<cc:TitleBar Title="SPT Installer" <cc:TitleBar Title="{Binding Title}"
XButtonCommand="{Binding CloseCommand}" XButtonCommand="{Binding CloseCommand}"
MinButtonCommand="{Binding MinimizeCommand}" MinButtonCommand="{Binding MinimizeCommand}"
/> />