@@ -19,10 +19,60 @@ public partial class AboutSimTools : Window
1919 public AboutSimTools ( )
2020 {
2121 InitializeComponent ( ) ;
22+ PopulateVersionInfo ( ) ;
2223 Loaded += ( _ , _ ) => StartSlideshow ( ) ;
2324 Closing += ( _ , _ ) => _slideTimer ? . Stop ( ) ;
2425 }
2526
27+ // ── Version info ──────────────────────────────────────────────────────────────
28+ //
29+ // • Version + Build — read from AssemblyName.Version (Major.Minor.Build, Build Revision)
30+ // • Git hash — read from AssemblyInformationalVersion ("x.y.z+<hash>")
31+ // • Compile date — last-write time of the executing assembly on disk
32+ //
33+ private void PopulateVersionInfo ( )
34+ {
35+ var asm = Assembly . GetExecutingAssembly ( ) ;
36+
37+ // Version: Major.Minor.Patch, Build <number>
38+ // ver.Major = Major (4)
39+ // ver.Minor = Minor (0)
40+ // ver.Build = Patch (1) ← .NET names this "Build"
41+ // ver.Revision = Build (3868) ← .NET names this "Revision"
42+ var ver = asm . GetName ( ) . Version ?? new Version ( 4 , 0 , 1 , 0 ) ;
43+ string versionBase = $ "{ ver . Major } .{ ver . Minor } .{ ver . Build } ";
44+ string buildPart = ver . Revision > 0 ? $ ", Build { ver . Revision } " : "" ;
45+
46+ // Short git hash from AssemblyInformationalVersion ("4.0.1.3868+abc1234...")
47+ string commitSuffix = "" ;
48+ string infoVer = asm . GetCustomAttribute < AssemblyInformationalVersionAttribute > ( )
49+ ? . InformationalVersion ?? "" ;
50+ int plusIdx = infoVer . IndexOf ( '+' ) ;
51+ if ( plusIdx >= 0 && plusIdx < infoVer . Length - 1 )
52+ {
53+ string hash = infoVer [ ( plusIdx + 1 ) ..] ;
54+ if ( hash . Length > 7 ) hash = hash [ ..7 ] ;
55+ commitSuffix = $ " ({ hash } )";
56+ }
57+
58+ // Compile date = last-write time of the assembly file
59+ string asmPath = asm . Location ;
60+ DateTime built = File . Exists ( asmPath ) ? File . GetLastWriteTime ( asmPath ) : DateTime . Now ;
61+ string builtStr = built . ToString ( "MM/dd/yyyy, h:mm tt" ) ;
62+
63+ // Rebuild Text5 Inlines — x:Name on <Run> does not generate code-behind fields
64+ Text5 . Inlines . Clear ( ) ;
65+ Text5 . Inlines . Add ( new System . Windows . Documents . Run ( $ "Version: { versionBase } { buildPart } { commitSuffix } ") ) ;
66+ Text5 . Inlines . Add ( new System . Windows . Documents . LineBreak ( ) ) ;
67+ Text5 . Inlines . Add ( new System . Windows . Documents . Run ( $ "Released: { builtStr } ") ) ;
68+ Text5 . Inlines . Add ( new System . Windows . Documents . LineBreak ( ) ) ;
69+ Text5 . Inlines . Add ( new System . Windows . Documents . Run ( "Website: http://www.simtools-app.com" ) ) ;
70+ Text5 . Inlines . Add ( new System . Windows . Documents . LineBreak ( ) ) ;
71+ int currentYear = DateTime . Now . Year ;
72+ string copyrightYear = currentYear > 2025 ? $ "2025\u2013 { currentYear } " : "2025" ;
73+ Text5 . Inlines . Add ( new System . Windows . Documents . Run ( $ "\u00a9 { copyrightYear } , Archeon Industries, LLC.") ) ;
74+ }
75+
2676 // ── Changelog button ──────────────────────────────────────────────────────
2777
2878 private void ChangelogButton_Click ( object sender , RoutedEventArgs e )
0 commit comments