@@ -12,7 +12,7 @@ public virtual void Show()
1212
1313 public virtual string GetSystemInfo ( )
1414 {
15- return SnapX . Core . Utils . OsInfo . GetFancyOSNameAndVersion ( ) ;
15+ return Core . Utils . OsInfo . GetFancyOSNameAndVersion ( ) ;
1616 }
1717 public virtual string GetTitle ( ) => Core . SnapX . Title ;
1818 public virtual string GetLicense ( ) => "GPL v3 or Later" ;
@@ -32,27 +32,26 @@ public virtual string GetCopyright() =>
3232 public virtual string GetRuntime ( ) => System . Runtime . InteropServices . RuntimeInformation . FrameworkDescription ;
3333 public virtual string GetOsPlatform ( ) => $ "{ Environment . OSVersion . Platform } { Environment . OSVersion . Version } ";
3434 [ UnconditionalSuppressMessage ( "Trimming" , "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code" , Justification = "<Pending>" ) ]
35- [ DynamicDependency ( DynamicallyAccessedMemberTypes . All , typeof ( GitVersionInformation ) ) ]
3635 [ RequiresUnreferencedCode ( "Uses reflection to access properties that may be removed by the trimmer." ) ]
3736 public virtual string GetBuildInformation ( )
3837 {
3938 var title = Assembly . GetExecutingAssembly ( ) . GetCustomAttribute < AssemblyTitleAttribute > ( ) ? . Title ?? Assembly . GetExecutingAssembly ( ) . FullName ;
4039 var flags = string . Join ( ", " , Core . SnapX . Flags ) ;
4140 var informationalVersion = Assembly . GetExecutingAssembly ( ) . GetCustomAttribute < AssemblyInformationalVersionAttribute > ( ) ? . InformationalVersion ?? "Unknown" ;
42-
43- var type = typeof ( GitVersionInformation ) ;
44- var gitCommitId = type . GetField ( "Sha" , BindingFlags . Public | BindingFlags . Static ) ? . GetValue ( null ) as string ;
45- var commitDateStr = type . GetField ( "CommitDate" , BindingFlags . Public | BindingFlags . Static ) ? . GetValue ( null ) as string ;
41+ var fileVersion = Assembly . GetExecutingAssembly ( ) . GetCustomAttribute < AssemblyFileVersionAttribute > ( ) ? . Version ?? "Unknown" ;
42+ var type = Type . GetType ( " GitVersionInformation" ) ;
43+ var gitCommitId = type ? . GetField ( "Sha" , BindingFlags . Public | BindingFlags . Static ) ? . GetValue ( null ) as string ;
44+ var commitDateStr = type ? . GetField ( "CommitDate" , BindingFlags . Public | BindingFlags . Static ) ? . GetValue ( null ) as string ;
4645 var gitCommitDate = DateTime . TryParse ( commitDateStr , out var parsedDate )
4746 ? parsedDate
4847 : new DateTime ( ) ;
49- var branchName = type . GetField ( "BranchName" , BindingFlags . Public | BindingFlags . Static ) ? . GetValue ( null ) ? . ToString ( ) ;
48+ var branchName = type ? . GetField ( "BranchName" , BindingFlags . Public | BindingFlags . Static ) ? . GetValue ( null ) ? . ToString ( ) ;
5049
51- return $ "{ title } v{ GitVersionInformation . AssemblySemFileVer } { Environment . NewLine } " +
50+ return $ "{ title } v{ fileVersion } { Environment . NewLine } " +
5251 $ "Flags: { flags } { Environment . NewLine } " +
5352 $ "Build: { Core . SnapX . Build } { Environment . NewLine } " +
5453 $ "Informational Version: { informationalVersion } (Branch: { branchName } ){ Environment . NewLine } " +
55- $ "Commit { gitCommitId } ({ gitCommitDate } )";
54+ $ "Commit { gitCommitId } ({ gitCommitDate . ToLocalTime ( ) } )";
5655 }
5756 public virtual string GetOsArchitecture ( ) => System . Runtime . InteropServices . RuntimeInformation . OSArchitecture . ToString ( ) ;
5857
0 commit comments