Version binding

This commit is contained in:
2026-06-16 23:00:06 +02:00
parent 1cc0cd306a
commit abe9164912
4 changed files with 29 additions and 0 deletions

23
StarterNG/AppInfo.cs Normal file
View 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;
}
}