diff --git a/EnvyUpdate/Debug.cs b/EnvyUpdate/Debug.cs
index 0ce50c9..5df7a21 100644
--- a/EnvyUpdate/Debug.cs
+++ b/EnvyUpdate/Debug.cs
@@ -6,11 +6,10 @@ namespace EnvyUpdate
{
class Debug
{
- readonly static string debugFilePath = GlobalVars.exepath + "debug.txt";
public static int LoadFakeIDs(string idType)
{
/*
- * Usage: Supply /debug flag to exe. Imitates a GTX 1080ti on Win10 x64 non-dch.
+ * Usage: Supply /debug flag to exe. Imitates a GTX 1080ti on Win10 x64 non-dch Game Ready Driver.
*/
switch (idType)
{
@@ -22,6 +21,8 @@ namespace EnvyUpdate
return 57;
case "dtcid":
return 0;
+ case "dtid":
+ return 1;
default:
return -1;
}
diff --git a/EnvyUpdate/MainWindow.xaml b/EnvyUpdate/MainWindow.xaml
index f5e1ec4..87ba0ab 100644
--- a/EnvyUpdate/MainWindow.xaml
+++ b/EnvyUpdate/MainWindow.xaml
@@ -7,19 +7,23 @@
xmlns:p="clr-namespace:EnvyUpdate.Properties"
xmlns:tb="http://www.hardcodet.net/taskbar"
mc:Ignorable="d"
- Title="EnvyUpdate" Height="160" Width="290" Icon="icon.ico" StateChanged="Window_StateChanged" Closing="Window_Closing" ResizeMode="CanMinimize">
+ Title="EnvyUpdate" Height="250" Width="300" Icon="icon.ico" StateChanged="Window_StateChanged" Closing="Window_Closing" ResizeMode="CanMinimize">
-
-
+
+
-
-
-
+
+
+
+
+
+
+
diff --git a/EnvyUpdate/MainWindow.xaml.cs b/EnvyUpdate/MainWindow.xaml.cs
index dda5af5..3ec6363 100644
--- a/EnvyUpdate/MainWindow.xaml.cs
+++ b/EnvyUpdate/MainWindow.xaml.cs
@@ -46,6 +46,11 @@ namespace EnvyUpdate
GlobalVars.isMobile = Util.IsMobile();
+ if (Util.IsDCH())
+ textblockLocalType.Text = "DCH";
+ else
+ textblockLocalType.Text = "Standard";
+
string locDriv = Util.GetLocDriv();
if (locDriv != null)
{
@@ -95,8 +100,12 @@ namespace EnvyUpdate
int pfid = 0;
int osid = 0;
int dtcid = 0;
+ int dtid = 0;
//int langid;
+ if (File.Exists(GlobalVars.exepath + "sd.envy"))
+ radioSD.IsChecked = true;
+
// This little bool check is necessary for debug mode on systems without an Nvidia GPU.
if (!isDebug)
{
@@ -104,6 +113,7 @@ namespace EnvyUpdate
pfid = Util.GetIDs("pfid");
osid = Util.GetIDs("osid");
dtcid = Util.GetDTCID();
+ //dtid = Util.GetDTID();
}
else
{
@@ -111,27 +121,38 @@ namespace EnvyUpdate
pfid = Debug.LoadFakeIDs("pfid");
osid = Debug.LoadFakeIDs("osid");
dtcid = Debug.LoadFakeIDs("dtcid");
+ dtid = Debug.LoadFakeIDs("dtid");
localDriv = Debug.LocalDriv();
textblockGPU.Text = localDriv;
textblockGPUName.Text = Debug.GPUname();
}
- gpuURL = "http://www.nvidia.com/Download/processDriver.aspx?psid=" + psid.ToString() + "&pfid=" + pfid.ToString() + "&osid=" + osid.ToString() + "&dtcid=" + dtcid.ToString(); // + "&lid=" + langid.ToString();
+ //Temporary Studio Driver override logic
+ try
+ {
+ if (radioSD.IsChecked == true)
+ dtid = 18;
+ else
+ dtid = 1;
+ }
+ catch (NullReferenceException)
+ { }
+
+ gpuURL = "http://www.nvidia.com/Download/processDriver.aspx?psid=" + psid.ToString() + "&pfid=" + pfid.ToString() + "&osid=" + osid.ToString() + "&dtcid=" + dtcid.ToString() + "&dtid=" + dtid.ToString(); // + "&lid=" + langid.ToString();
WebClient c = new WebClient();
gpuURL = c.DownloadString(gpuURL);
string pContent = c.DownloadString(gpuURL);
- var pattern = @"\d{3}\.\d{2} ";
+ var pattern = @"Windows\/\d{3}\.\d{2}";
Regex rgx = new Regex(pattern);
var matches = rgx.Matches(pContent);
- onlineDriv = Convert.ToString(matches[0]);
- onlineDriv = onlineDriv.Remove(onlineDriv.Length - 5);
+ onlineDriv = Regex.Replace(Convert.ToString(matches[0]), "Windows/", "");
textblockOnline.Text = onlineDriv;
c.Dispose();
if (float.Parse(localDriv) < float.Parse(onlineDriv))
{
textblockOnline.Foreground = Brushes.Red;
- buttonDL.Visibility = Visibility.Visible;
+ buttonDL.IsEnabled = true;
Notify.ShowDrivUpdatePopup();
}
else
@@ -191,5 +212,23 @@ namespace EnvyUpdate
else
e.Cancel = true;
}
+
+ private void radioGRD_Checked(object sender, RoutedEventArgs e)
+ {
+ if (File.Exists(GlobalVars.exepath + "sd.envy"))
+ {
+ File.Delete(GlobalVars.exepath + "sd.envy");
+ Load();
+ }
+ }
+
+ private void radioSD_Checked(object sender, RoutedEventArgs e)
+ {
+ if (!File.Exists(GlobalVars.exepath + "sd.envy"))
+ {
+ File.Create(GlobalVars.exepath + "sd.envy").Close();
+ Load();
+ }
+ }
}
}
\ No newline at end of file
diff --git a/EnvyUpdate/Properties/Resources.Designer.cs b/EnvyUpdate/Properties/Resources.Designer.cs
index 3fcdfdc..9996ebe 100644
--- a/EnvyUpdate/Properties/Resources.Designer.cs
+++ b/EnvyUpdate/Properties/Resources.Designer.cs
@@ -177,6 +177,15 @@ namespace EnvyUpdate.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Local driver type:.
+ ///
+ public static string ui_localdriver_type {
+ get {
+ return ResourceManager.GetString("ui_localdriver_type", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Online driver version:.
///
diff --git a/EnvyUpdate/Properties/Resources.de.resx b/EnvyUpdate/Properties/Resources.de.resx
index 6e96858..b0786cf 100644
--- a/EnvyUpdate/Properties/Resources.de.resx
+++ b/EnvyUpdate/Properties/Resources.de.resx
@@ -156,6 +156,9 @@
Lokale Treiberversion:
+
+ Lokaler Treibertyp:
+
Online Treiberversion:
diff --git a/EnvyUpdate/Properties/Resources.resx b/EnvyUpdate/Properties/Resources.resx
index 24f593d..c6943c4 100644
--- a/EnvyUpdate/Properties/Resources.resx
+++ b/EnvyUpdate/Properties/Resources.resx
@@ -156,6 +156,9 @@
Local driver version:
+
+ Local driver type:
+
Online driver version:
diff --git a/EnvyUpdate/Util.cs b/EnvyUpdate/Util.cs
index d506d45..2d143c8 100644
--- a/EnvyUpdate/Util.cs
+++ b/EnvyUpdate/Util.cs
@@ -336,7 +336,7 @@ namespace EnvyUpdate
}
catch (Exception ex)
{
- if (ex.InnerException is NullReferenceException)
+ if (ex.Message == "Object reference not set to an instance of an object." || ex.InnerException is NullReferenceException)
{
// Assume no DCH driver is installed if key is not found.
return false;
@@ -369,5 +369,16 @@ namespace EnvyUpdate
}
return dtcid;
}
+
+ public static int GetDTID()
+ {
+ /*
+ * 1 = Game Ready Driver (GRD)
+ * 18 = Studio Driver (SD)
+ */
+ //TODO: find way to differentiate between driver types
+
+ return 1;
+ }
}
}
\ No newline at end of file