From 6b745618e607628ca7208570df6ccdd5139099f3 Mon Sep 17 00:00:00 2001 From: Jakob Date: Fri, 14 Jul 2023 12:05:06 +0200 Subject: [PATCH] fix debug & skip --- EnvyUpdate/DashboardPage.xaml | 2 +- EnvyUpdate/DashboardPage.xaml.cs | 17 +++++++++++------ EnvyUpdate/MainWindow.xaml.cs | 21 +++++++++------------ 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/EnvyUpdate/DashboardPage.xaml b/EnvyUpdate/DashboardPage.xaml index 31e3ab6..a9a1d8d 100644 --- a/EnvyUpdate/DashboardPage.xaml +++ b/EnvyUpdate/DashboardPage.xaml @@ -44,7 +44,7 @@ Message="..." Severity="Informational" /> - + diff --git a/EnvyUpdate/DashboardPage.xaml.cs b/EnvyUpdate/DashboardPage.xaml.cs index 62f41bc..e88ea01 100644 --- a/EnvyUpdate/DashboardPage.xaml.cs +++ b/EnvyUpdate/DashboardPage.xaml.cs @@ -36,7 +36,10 @@ namespace EnvyUpdate { InitializeComponent(); - localDriv = Util.GetLocDriv(); + if (Debug.isFake) + localDriv = Debug.LocalDriv(); + else + localDriv = Util.GetLocDriv(); Debug.LogToFile("INFO Local driver version: " + localDriv); @@ -48,10 +51,10 @@ namespace EnvyUpdate Debug.LogToFile("INFO Detecting driver type."); - if (Util.IsDCH()) - textblockLocalType.Text = "DCH"; - else if (Debug.isFake) + if (Debug.isFake) textblockLocalType.Text = "DCH (Debug)"; + else if (Util.IsDCH()) + textblockLocalType.Text = "DCH"; else textblockLocalType.Text = "Standard"; @@ -91,6 +94,8 @@ namespace EnvyUpdate driverFileChangedWatcher.EnableRaisingEvents = true; Debug.LogToFile("INFO Started update file system watcher."); } + else + Debug.LogToFile("WARN Could not start update file system watcher. Path not found: " + watchDirPath); Load(); } @@ -119,7 +124,7 @@ namespace EnvyUpdate skippedVer = File.ReadLines(GlobalVars.exedirectory + "skip.envy").First(); } - // This little bool check is necessary for debug mode on systems without an Nvidia GPU. + // This little bool check is necessary for debug fake mode. if (Debug.isFake) { localDriv = Debug.LocalDriv(); @@ -296,7 +301,7 @@ namespace EnvyUpdate } } - private void buttonSkip_Click(object sender, RoutedEventArgs e) + private void buttonSkipVersion_Click(object sender, RoutedEventArgs e) { Debug.LogToFile("INFO Skipping version."); skippedVer = onlineDriv; diff --git a/EnvyUpdate/MainWindow.xaml.cs b/EnvyUpdate/MainWindow.xaml.cs index 5353f49..1d9eb37 100644 --- a/EnvyUpdate/MainWindow.xaml.cs +++ b/EnvyUpdate/MainWindow.xaml.cs @@ -61,19 +61,16 @@ namespace EnvyUpdate Util.UninstallAll(); } - if (!Util.IsNvidia()) + if (arguments.Contains("/fake")) { - if (arguments.Contains("/fake")) - { - Debug.isFake = true; - Debug.LogToFile("WARN Faking GPU with debug info."); - } - else - { - Debug.LogToFile("FATAL No supported GPU found, terminating."); - MessageBox.Show(Properties.Resources.no_compatible_gpu); - Environment.Exit(255); - } + Debug.isFake = true; + Debug.LogToFile("WARN Faking GPU with debug info."); + } + else if (!Util.IsNvidia()) + { + Debug.LogToFile("FATAL No supported GPU found, terminating."); + MessageBox.Show(Properties.Resources.no_compatible_gpu); + Environment.Exit(255); } //Check if launched as miminized with arg