diff --git a/EnvyUpdate/App.xaml b/EnvyUpdate/App.xaml index fa5b264..414c0d4 100644 --- a/EnvyUpdate/App.xaml +++ b/EnvyUpdate/App.xaml @@ -2,8 +2,7 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:EnvyUpdate" - StartupUri="MainWindow.xaml" - DispatcherUnhandledException="Application_DispatcherUnhandledException"> + StartupUri="MainWindow.xaml"> diff --git a/EnvyUpdate/App.xaml.cs b/EnvyUpdate/App.xaml.cs index 957513d..35ec068 100644 --- a/EnvyUpdate/App.xaml.cs +++ b/EnvyUpdate/App.xaml.cs @@ -14,10 +14,5 @@ namespace EnvyUpdate /// public partial class App : Application { - public bool DoHandle { get; set; } - private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) - { - MessageBox.Show(e.Exception.ToString()); - } } } diff --git a/EnvyUpdate/MainWindow.xaml.cs b/EnvyUpdate/MainWindow.xaml.cs index 6e9e62b..dc683d6 100644 --- a/EnvyUpdate/MainWindow.xaml.cs +++ b/EnvyUpdate/MainWindow.xaml.cs @@ -152,14 +152,31 @@ namespace EnvyUpdate textblockOnline.Text = onlineDriv; c.Dispose(); - if (float.Parse(localDriv) < float.Parse(onlineDriv)) + try { - textblockOnline.Foreground = Brushes.Red; - buttonDL.IsEnabled = true; - Notify.ShowDrivUpdatePopup(); + if (float.Parse(localDriv) < float.Parse(onlineDriv)) + { + textblockOnline.Foreground = Brushes.Red; + buttonDL.IsEnabled = true; + Notify.ShowDrivUpdatePopup(); + } + else + textblockOnline.Foreground = Brushes.Green; + } + catch (FormatException) + { + //Thank you locales. Some languages need , instead of . + string cLocalDriv = localDriv.Replace('.', ','); + string cOnlineDriv = onlineDriv.Replace('.', ','); + if (float.Parse(cLocalDriv) < float.Parse(cOnlineDriv)) + { + textblockOnline.Foreground = Brushes.Red; + buttonDL.IsEnabled = true; + Notify.ShowDrivUpdatePopup(); + } + else + textblockOnline.Foreground = Brushes.Green; } - else - textblockOnline.Foreground = Brushes.Green; if (GlobalVars.exepath == GlobalVars.appdata) { diff --git a/EnvyUpdate/Util.cs b/EnvyUpdate/Util.cs index 70fc013..ab0ed62 100644 --- a/EnvyUpdate/Util.cs +++ b/EnvyUpdate/Util.cs @@ -295,7 +295,7 @@ namespace EnvyUpdate { GPUName = obj["VideoProcessor"].ToString().ToLower(); // Remove any 3GB, 6GB or similar from name. We don't need to know the VRAM to get results. - GPUName = Regex.Replace(GPUName, "\\d+GB", ""); + GPUName = Regex.Replace(GPUName, " \\d+gb", ""); GPUName = Regex.Replace(GPUName, "nvidia ", ""); } else