Handle StaticExports.GetVersionString() being missing

* If the user is somehow running a really new UI with old DLL, handle
  the exception and continue to allow the user to update without
  crashing.
This commit is contained in:
baldurk
2016-08-30 17:37:06 +02:00
parent bb5f8c9bec
commit 1faf46ddc5
2 changed files with 23 additions and 2 deletions
+13 -1
View File
@@ -62,7 +62,19 @@ namespace renderdocui.Windows.Dialogs
updateNotes.Select(0, 0);
updateMetadata.Text = "v" + StaticExports.GetVersionString() +
string curver = "?.?";
try
{
curver = StaticExports.GetVersionString();
}
catch (System.Exception)
{
// probably StaticExports.GetVersionString is missing, which means an old
// version is running
}
updateMetadata.Text = "v" + curver +
Environment.NewLine + Environment.NewLine +
String.Format("v{0}", response_split[0]) +
Environment.NewLine + Environment.NewLine +
+10 -1
View File
@@ -1284,7 +1284,16 @@ namespace renderdocui.Windows
private bool IsVersionMismatched()
{
return "v" + StaticExports.GetVersionString() != VersionString;
try
{
return "v" + StaticExports.GetVersionString() != VersionString;
}
catch (System.Exception)
{
// probably StaticExports.GetVersionString is missing, which means an old
// version is running
return true;
}
}
private bool HandleMismatchedVersions()