@@ -85,12 +85,7 @@ static TorchBase()
8585 public ITorchConfig Config { get ; protected set ; }
8686
8787 /// <inheritdoc />
88- public Version TorchVersion { get ; }
89-
90- /// <summary>
91- /// The version of Torch used, with extra data.
92- /// </summary>
93- public string TorchVersionVerbose { get ; }
88+ public InformationalVersion TorchVersion { get ; }
9489
9590 /// <inheritdoc />
9691 public Version GameVersion { get ; private set ; }
@@ -139,10 +134,15 @@ protected TorchBase()
139134
140135 Instance = this ;
141136
142- TorchVersion = Assembly . GetExecutingAssembly ( ) . GetName ( ) . Version ;
143- TorchVersionVerbose = Assembly . GetEntryAssembly ( )
137+ var versionString = Assembly . GetEntryAssembly ( )
144138 . GetCustomAttribute < AssemblyInformationalVersionAttribute > ( )
145- ? . InformationalVersion ?? TorchVersion . ToString ( ) ;
139+ . InformationalVersion ;
140+
141+ if ( ! InformationalVersion . TryParse ( versionString , out InformationalVersion version ) )
142+ throw new TypeLoadException ( "Unable to parse the Torch version from the assembly." ) ;
143+
144+ TorchVersion = version ;
145+
146146 RunArgs = new string [ 0 ] ;
147147
148148 Managers = new DependencyManager ( ) ;
@@ -326,7 +326,7 @@ public virtual void Init()
326326#else
327327 Log . Info ( "RELEASE" ) ;
328328#endif
329- Log . Info ( $ "Torch Version: { TorchVersionVerbose } ") ;
329+ Log . Info ( $ "Torch Version: { TorchVersion } ") ;
330330 Log . Info ( $ "Game Version: { GameVersion } ") ;
331331 Log . Info ( $ "Executing assembly: { Assembly . GetEntryAssembly ( ) . FullName } ") ;
332332 Log . Info ( $ "Executing directory: { AppDomain . CurrentDomain . BaseDirectory } ") ;
0 commit comments