diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-05-25 01:14:40 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-05-25 01:14:40 -0400 |
commit | 3129f67eb1f162e06d96854f319b10ccf583f0aa (patch) | |
tree | 67f7063dd4f362b018a677e6e9d3bd1cc66f63da /src/SMAPI.Installer | |
parent | 2a7bcb28f6a390e165c2cb8817f333aad750a032 (diff) | |
download | SMAPI-3129f67eb1f162e06d96854f319b10ccf583f0aa.tar.gz SMAPI-3129f67eb1f162e06d96854f319b10ccf583f0aa.tar.bz2 SMAPI-3129f67eb1f162e06d96854f319b10ccf583f0aa.zip |
add semantic version to toolkit (#532)
Diffstat (limited to 'src/SMAPI.Installer')
-rw-r--r-- | src/SMAPI.Installer/InteractiveInstaller.cs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/SMAPI.Installer/InteractiveInstaller.cs b/src/SMAPI.Installer/InteractiveInstaller.cs index ace560e5..6e4cb95d 100644 --- a/src/SMAPI.Installer/InteractiveInstaller.cs +++ b/src/SMAPI.Installer/InteractiveInstaller.cs @@ -152,7 +152,7 @@ namespace StardewModdingApi.Installer ** Get platform & set window title ****/ Platform platform = EnvironmentUtility.DetectPlatform(); - Console.Title = $"SMAPI {new SemanticVersionImpl(this.GetType().Assembly.GetName().Version)} installer on {platform} {EnvironmentUtility.GetFriendlyPlatformName(platform)}"; + Console.Title = $"SMAPI {this.GetDisplayVersion(this.GetType().Assembly.GetName().Version)} installer on {platform} {EnvironmentUtility.GetFriendlyPlatformName(platform)}"; Console.WriteLine(); #if SMAPI_FOR_WINDOWS @@ -421,6 +421,16 @@ namespace StardewModdingApi.Installer /********* ** Private methods *********/ + /// <summary>Get the display text for an assembly version.</summary> + /// <param name="version">The assembly version.</param> + private string GetDisplayVersion(Version version) + { + string str = $"{version.Major}.{version.Minor}"; + if (version.Build != 0) + str += $".{version.Build}"; + return str; + } + /// <summary>Get the value of a key in the Windows registry.</summary> /// <param name="key">The full path of the registry key relative to HKLM.</param> /// <param name="name">The name of the value.</param> |