From 645c9e72d24c0a6959d2e181c70bc2552eb79a5b Mon Sep 17 00:00:00 2001 From: Jakob Date: Mon, 3 Apr 2023 21:01:32 +0200 Subject: [PATCH 01/70] fix debug log --- EnvyUpdate/Debug.cs | 2 +- EnvyUpdate/MainWindow.xaml.cs | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/EnvyUpdate/Debug.cs b/EnvyUpdate/Debug.cs index 01e98b9..a239764 100644 --- a/EnvyUpdate/Debug.cs +++ b/EnvyUpdate/Debug.cs @@ -53,7 +53,7 @@ namespace EnvyUpdate public static void LogToFile(string content) { if (isVerbose) - System.IO.File.AppendAllText(Debug.debugFile, content); + System.IO.File.AppendAllText(Debug.debugFile, content + "\n"); } } } diff --git a/EnvyUpdate/MainWindow.xaml.cs b/EnvyUpdate/MainWindow.xaml.cs index d7f1ab3..cd86d62 100644 --- a/EnvyUpdate/MainWindow.xaml.cs +++ b/EnvyUpdate/MainWindow.xaml.cs @@ -39,8 +39,6 @@ namespace EnvyUpdate if (Debug.isVerbose) { - if (!File.Exists(Debug.debugFile)) - File.CreateText(Debug.debugFile); File.AppendAllText(Debug.debugFile, "INFO Starting EnvyUpdate, version " + System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).FileVersion); } From 90fc53ce0081a265edd0b86645e6b3f6f274a03b Mon Sep 17 00:00:00 2001 From: Jakob Date: Sat, 8 Jul 2023 23:18:53 +0200 Subject: [PATCH 02/70] potential solution for #31? --- EnvyUpdate/Properties/AssemblyInfo.cs | 4 +-- EnvyUpdate/Util.cs | 52 ++++++++++++++++----------- 2 files changed, 33 insertions(+), 23 deletions(-) diff --git a/EnvyUpdate/Properties/AssemblyInfo.cs b/EnvyUpdate/Properties/AssemblyInfo.cs index a45fa1a..2659d08 100644 --- a/EnvyUpdate/Properties/AssemblyInfo.cs +++ b/EnvyUpdate/Properties/AssemblyInfo.cs @@ -49,5 +49,5 @@ using System.Windows; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.18")] -[assembly: AssemblyFileVersion("2.18")] +[assembly: AssemblyVersion("2.19")] +[assembly: AssemblyFileVersion("2.19")] diff --git a/EnvyUpdate/Util.cs b/EnvyUpdate/Util.cs index dd84e97..328a24d 100644 --- a/EnvyUpdate/Util.cs +++ b/EnvyUpdate/Util.cs @@ -153,28 +153,38 @@ namespace EnvyUpdate Debug.LogToFile("INFO Got Nvidia GPU list."); if (xmlcontent == null) - Debug.LogToFile("WARN GPU list is NULL! This is a possible error source."); - - XDocument xDoc = XDocument.Parse(xmlcontent); - string gpuName = GetGPUName(true); - - switch (IDtype) { - case "psid": - id = GetValueFromName(xDoc, gpuName, true); - Debug.LogToFile("INFO Got psid: " + id); - break; - case "pfid": - id = GetValueFromName(xDoc, gpuName, false); - Debug.LogToFile("INFO Got pfid: " + id); - break; - case "osid": - id = GetOSID(); - Debug.LogToFile("INFO Got osid: " + id); - break; - default: - Debug.LogToFile("WARN GetIDs was called, but nothing was specified."); - break; + Debug.LogToFile("WARN GPU list is NULL! This is a possible error source."); + switch (IDtype) + { + case "osid": + id = GetOSID(); + Debug.LogToFile("WARN Ignore previous warning, just getting osid."); + Debug.LogToFile("INFO Got osid: " + id); + break; + default: + Debug.LogToFile("WARN GetIDs was called, but nothing was specified."); + break; + } + } + else + { + XDocument xDoc = XDocument.Parse(xmlcontent); + string gpuName = GetGPUName(true); + switch (IDtype) + { + case "psid": + id = GetValueFromName(xDoc, gpuName, true); + Debug.LogToFile("INFO Got psid: " + id); + break; + case "pfid": + id = GetValueFromName(xDoc, gpuName, false); + Debug.LogToFile("INFO Got pfid: " + id); + break; + default: + Debug.LogToFile("WARN GetIDs was called, but nothing was specified."); + break; + } } return id; From d347ccefdf59b7b0fb72cbba87d368f0b33d2096 Mon Sep 17 00:00:00 2001 From: Jakob Date: Sun, 9 Jul 2023 18:19:33 +0200 Subject: [PATCH 03/70] improve logging --- EnvyUpdate/Debug.cs | 1 - EnvyUpdate/InfoWindow.xaml | 26 ++++++++++++++++---------- EnvyUpdate/InfoWindow.xaml.cs | 18 ++++++++++++++++++ EnvyUpdate/MainWindow.xaml.cs | 18 ++++++++++++++---- EnvyUpdate/Util.cs | 21 +++++++++++++++++---- 5 files changed, 65 insertions(+), 19 deletions(-) diff --git a/EnvyUpdate/Debug.cs b/EnvyUpdate/Debug.cs index a239764..43e54b9 100644 --- a/EnvyUpdate/Debug.cs +++ b/EnvyUpdate/Debug.cs @@ -49,7 +49,6 @@ namespace EnvyUpdate return "Nvidia GeForce RTX 4080 (debug)"; } - [ConditionalAttribute("DEBUG")] public static void LogToFile(string content) { if (isVerbose) diff --git a/EnvyUpdate/InfoWindow.xaml b/EnvyUpdate/InfoWindow.xaml index bdc6ca6..e9d09c5 100644 --- a/EnvyUpdate/InfoWindow.xaml +++ b/EnvyUpdate/InfoWindow.xaml @@ -7,14 +7,20 @@ xmlns:p="clr-namespace:EnvyUpdate.Properties" mc:Ignorable="d" Title="" Height="400" Width="600" ResizeMode="NoResize" WindowStyle="ToolWindow" SizeToContent="WidthAndHeight"> - - -