File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ public static string Version
1414 {
1515 if ( string . IsNullOrEmpty ( _Version ) )
1616 {
17- SetVerion ( ) ;
17+ SetVersion ( ) ;
1818 }
1919 return _Version ;
2020 }
@@ -25,7 +25,7 @@ public static string VersionDate { get
2525 {
2626 if ( string . IsNullOrEmpty ( _VersionDate ) )
2727 {
28- SetVerion ( ) ;
28+ SetVersion ( ) ;
2929 }
3030 return _VersionDate ;
3131 }
@@ -45,14 +45,14 @@ public static void Main(string[] args)
4545 TypeNameHandling = TypeNameHandling . Auto ,
4646 } ;
4747
48- SetVerion ( ) ;
48+ SetVersion ( ) ;
4949
5050 BuildAvaloniaApp ( )
5151 . StartWithClassicDesktopLifetime ( args ) ;
5252 }
5353
5454
55- public static void SetVerion ( )
55+ public static void SetVersion ( )
5656 {
5757 try
5858 {
@@ -61,15 +61,20 @@ public static void SetVerion()
6161 _Version = $ "{ version . Major } .{ version . Minor } .{ version . Build } ";
6262 if ( version . Revision != 0 )
6363 {
64- _Version = $ "{ Version } - beta { version . Revision } ";
64+ _Version = $ "{ _Version } - beta { version . Revision } ";
6565 }
66- var buildDate = System . IO . File . GetLastWriteTime ( assembly . Location ) ;
66+
67+ string path = assembly . Location ;
68+ if ( string . IsNullOrEmpty ( path ) )
69+ path = System . Diagnostics . Process . GetCurrentProcess ( ) . MainModule . FileName ;
70+
71+ var buildDate = System . IO . File . GetLastWriteTime ( path ) ;
6772 _VersionDate = buildDate . ToString ( "yyyy.MM.dd" ) ;
6873 }
6974 catch
7075 {
71- _Version = "" ;
72- _VersionDate = "" ;
76+ _Version = "Unknown " ;
77+ _VersionDate = "Unknown " ;
7378 }
7479 }
7580
You can’t perform that action at this time.
0 commit comments