diff --git a/EnvyUpdate/MainWindow.xaml b/EnvyUpdate/MainWindow.xaml index 4137ab0..2976a4c 100644 --- a/EnvyUpdate/MainWindow.xaml +++ b/EnvyUpdate/MainWindow.xaml @@ -6,7 +6,7 @@ xmlns:local="clr-namespace:EnvyUpdate" xmlns:tb="http://www.hardcodet.net/taskbar" mc:Ignorable="d" - Title="EnvyUpdate" Height="170.864" Width="463.435" Icon="icon.ico" ResizeMode="CanMinimize" StateChanged="Window_StateChanged" Closing="Window_Closing"> + Title="EnvyUpdate" Height="170" Width="463" Icon="icon.ico" ResizeMode="CanMinimize" StateChanged="Window_StateChanged" Closing="Window_Closing"> diff --git a/EnvyUpdate/MainWindow.xaml.cs b/EnvyUpdate/MainWindow.xaml.cs index dd72dc7..74d2058 100644 --- a/EnvyUpdate/MainWindow.xaml.cs +++ b/EnvyUpdate/MainWindow.xaml.cs @@ -21,8 +21,7 @@ namespace EnvyUpdate private readonly string exeloc = System.Reflection.Assembly.GetEntryAssembly().Location; private readonly string exepath = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + "\\"; private readonly string startmenu = Environment.GetFolderPath(Environment.SpecialFolder.StartMenu); - private readonly string version = "1.2"; - private readonly string argument = Environment.GetCommandLineArgs()[1]; + private readonly string version = "1.3"; public MainWindow() { @@ -55,25 +54,28 @@ namespace EnvyUpdate //Silently fail. } } - - if (argument == "--ignore-gpu") + try { - MessageBox.Show("Skipping GPU check!"); - textblockGPU.Text = "Check skipped."; - } - else - { - if (Util.GetLocDriv() != null) + if (Environment.GetCommandLineArgs()[1] == "--ignore-gpu") { - localDriv = Util.GetLocDriv(); - textblockGPU.Text = localDriv; + MessageBox.Show("Skipping GPU check!"); + textblockGPU.Text = "Check skipped."; } else { - MessageBox.Show("No NVIDIA GPU found. Application will exit."); - Environment.Exit(255); + if (Util.GetLocDriv() != null) + { + localDriv = Util.GetLocDriv(); + textblockGPU.Text = localDriv; + } + else + { + MessageBox.Show("No NVIDIA GPU found. Application will exit."); + Environment.Exit(255); + } } } + catch (IndexOutOfRangeException) { } if (File.Exists(appdata + "nvidia-update.txt")) {