From bc26b5caac932ed59dd75be5a5f092ae4a3334c5 Mon Sep 17 00:00:00 2001 From: fyr77 Date: Sun, 2 May 2021 16:24:05 +0200 Subject: [PATCH] Bump and argh --- EnvyUpdate/GlobalVars.cs | 2 +- EnvyUpdate/Util.cs | 25 ++++++++++++++----------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/EnvyUpdate/GlobalVars.cs b/EnvyUpdate/GlobalVars.cs index 352f9cb..068498c 100644 --- a/EnvyUpdate/GlobalVars.cs +++ b/EnvyUpdate/GlobalVars.cs @@ -9,7 +9,7 @@ namespace EnvyUpdate public static readonly string exeloc = System.Reflection.Assembly.GetEntryAssembly().Location; public static readonly string exepath = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + "\\"; public static readonly string startmenu = Environment.GetFolderPath(Environment.SpecialFolder.StartMenu); - public static readonly float version = 2.4F; + public static readonly float version = 2.5F; public static readonly string appdata = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\envyupdate\\"; public static readonly string startup = Environment.GetFolderPath(Environment.SpecialFolder.Startup); public static readonly string desktopOverride = exepath + "desktop.envy"; diff --git a/EnvyUpdate/Util.cs b/EnvyUpdate/Util.cs index ecfa422..0a826b1 100644 --- a/EnvyUpdate/Util.cs +++ b/EnvyUpdate/Util.cs @@ -394,19 +394,22 @@ namespace EnvyUpdate // Assume no DCH driver is installed if key is not found. return false; } - else if (ex.InnerException is System.Security.SecurityException) - { - //Registry reading error. Check for existance of file nvsvs.dll instead. - if (System.IO.File.Exists(Path.Combine(Environment.SystemDirectory, "nvsvs.dll"))) - return true; - else - return false; - } else { - MessageBox.Show("An error has occured. Please report this on GitHub.\nError:" + ex.Message); - Environment.Exit(20); - return false; + try + { + //Registry reading error. Check for existance of file nvsvs.dll instead. + if (System.IO.File.Exists(Path.Combine(Environment.SystemDirectory, "nvsvs.dll"))) + return true; + else + return false; + } + catch (Exception) + { + MessageBox.Show("An error has occured. Please report this on GitHub.\nError:" + ex.Message); + Environment.Exit(20); + return false; + } } } }