diff --git a/tns2tool/Program.cs b/tns2tool/Program.cs index f5efd5c..f3e4aef 100644 --- a/tns2tool/Program.cs +++ b/tns2tool/Program.cs @@ -27,8 +27,20 @@ static void PopulateVersionInfo() VersionMinor = (byte)version.Minor; VersionRevision = (byte)version.Revision; - InformationalVersion = - FileVersionInfo.GetVersionInfo(Environment.ProcessPath!).ProductVersion!; + try + { + InformationalVersion = + FileVersionInfo.GetVersionInfo(Environment.ProcessPath!).ProductVersion!; + } + catch (Exception ex) + { +#if DEBUG + Console.WriteLine("Error getting InformationalVersion: " + ex.Message); +#endif + + // fallback informational version, hopefully we never need this + InformationalVersion = $"{VersionMajor}.{VersionMinor}.{VersionRevision}"; + } } static void Main(string[] args)