mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-19 15:02:15 +01:00
Version binding
This commit is contained in:
23
StarterNG/AppInfo.cs
Normal file
23
StarterNG/AppInfo.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Reflection;
|
||||
|
||||
namespace StarterNG;
|
||||
|
||||
/// <summary>Static, display-ready information about the running launcher build.</summary>
|
||||
public static class AppInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// The launcher's assembly version (e.g. "1.2.3.4"), with a " (DEBUG)" suffix
|
||||
/// appended for Debug builds so debug and release binaries are easy to tell
|
||||
/// apart. Computed once; safe to bind with {x:Static}.
|
||||
/// </summary>
|
||||
public static string Version { get; } = BuildVersion();
|
||||
|
||||
private static string BuildVersion()
|
||||
{
|
||||
string text = Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "0.0.0.0";
|
||||
#if DEBUG
|
||||
text += " (DEBUG)";
|
||||
#endif
|
||||
return text;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user