Properly detect the version from the program file

This commit is contained in:
Timothy Baldridge 2022-08-19 22:02:44 -06:00
parent 8fd5794936
commit 40917df822
2 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,8 @@
### Changelog
#### Version - 3.0.0.3 -
* Properly detect the program version
#### Version - 3.0.0.2 - 8/19/2022
* Be more tolerant of bad picture Urls while validating Nexus Downloads (thanks ForgottenGlory)
* Fix loading and saving of several compiler fields

View File

@ -130,7 +130,12 @@ namespace Wabbajack
try
{
var assembly = Assembly.GetExecutingAssembly();
var fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
var location = assembly.Location;
if (string.IsNullOrWhiteSpace(location))
location = Process.GetCurrentProcess().MainModule?.FileName ?? "";
_logger.LogInformation("App Location: {Location}", assembly.Location);
var fvi = FileVersionInfo.GetVersionInfo(location);
Consts.CurrentMinimumWabbajackVersion = Version.Parse(fvi.FileVersion);
VersionDisplay = $"v{fvi.FileVersion}";
AppName = "WABBAJACK " + VersionDisplay;