Updated to include new dir, inclusion of tags. Version appears in Control Panel now. Also appears in TItlebar of AppWindow.

This commit is contained in:
2025-10-10 14:32:49 +08:00
parent bab6cf7b75
commit 62cf2425b1
4 changed files with 170 additions and 83 deletions

View File

@@ -57,8 +57,24 @@ namespace LD_SysInfo
System.Net.ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
InitializeComponent();
var fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
VersionTextBlock.Text = $"v{fvi.ProductVersion}";
var exePath = Assembly.GetEntryAssembly()?.Location;
if (string.IsNullOrEmpty(exePath))
{
exePath = Process.GetCurrentProcess().MainModule?.FileName;
}
if (!string.IsNullOrEmpty(exePath))
{
var fvi = FileVersionInfo.GetVersionInfo(exePath);
var productVersion = fvi.ProductVersion ?? "0.0.0";
var cleanVersion = productVersion.Split('+')[0];
VersionTextBlock.Text = $"v{cleanVersion}";
}
else
{
VersionTextBlock.Text = "v0.0.0";
}
LoadConfig();
DisplaySystemInfo();
AutoLogin();