add check for cards not supporting studio drivers

This commit is contained in:
Jakob 2023-03-14 20:59:44 +01:00
parent 25bd864e76
commit 2e4fa930ff
5 changed files with 45 additions and 3 deletions

View file

@ -146,7 +146,31 @@ namespace EnvyUpdate
textblockGPUName.Text = Debug.GPUname(); textblockGPUName.Text = Debug.GPUname();
} }
gpuURL = Util.GetGpuUrl(); try
{
gpuURL = Util.GetGpuUrl();
}
catch (ArgumentException)
{
try
{
// disable SD and try with GRD
if (File.Exists(GlobalVars.exepath + "sd.envy"))
{
File.Delete(GlobalVars.exepath + "sd.envy");
}
gpuURL = Util.GetGpuUrl(); //try again with GRD
MessageBox.Show(Properties.Resources.ui_studionotsupported);
radioGRD.IsChecked = true;
}
catch (ArgumentException)
{
// Now we have a problem.
MessageBox.Show("ERROR: Invalid API response from Nvidia. Please file an issue on GitHub.");
Environment.Exit(10);
}
}
using (var c = new WebClient()) using (var c = new WebClient())
{ {

View file

@ -222,6 +222,15 @@ namespace EnvyUpdate.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Studio Driver is not supported by this graphics card..
/// </summary>
public static string ui_studionotsupported {
get {
return ResourceManager.GetString("ui_studionotsupported", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Are you sure you want to uninstall EnvyUpdate?. /// Looks up a localized string similar to Are you sure you want to uninstall EnvyUpdate?.
/// </summary> /// </summary>

View file

@ -171,6 +171,9 @@
<data name="ui_skipversion" xml:space="preserve"> <data name="ui_skipversion" xml:space="preserve">
<value>Diese Version überspringen</value> <value>Diese Version überspringen</value>
</data> </data>
<data name="ui_studionotsupported" xml:space="preserve">
<value>Studio Treiber wird von dieser Grafikkarte nicht unterstützt.</value>
</data>
<data name="uninstall_confirm" xml:space="preserve"> <data name="uninstall_confirm" xml:space="preserve">
<value>Sind Sie sich sicher, dass Sie EnvyUpdate deinstallieren wollen?</value> <value>Sind Sie sich sicher, dass Sie EnvyUpdate deinstallieren wollen?</value>
</data> </data>

View file

@ -171,6 +171,9 @@
<data name="ui_skipversion" xml:space="preserve"> <data name="ui_skipversion" xml:space="preserve">
<value>Skip this version</value> <value>Skip this version</value>
</data> </data>
<data name="ui_studionotsupported" xml:space="preserve">
<value>Studio Driver is not supported by this graphics card.</value>
</data>
<data name="uninstall_confirm" xml:space="preserve"> <data name="uninstall_confirm" xml:space="preserve">
<value>Are you sure you want to uninstall EnvyUpdate?</value> <value>Are you sure you want to uninstall EnvyUpdate?</value>
</data> </data>

View file

@ -394,8 +394,6 @@ namespace EnvyUpdate
public static string GetGpuUrl() public static string GetGpuUrl()
{ {
//TODO: Make a list of languages and match OS language to driver
//int langid;
int psid; int psid;
int pfid; int pfid;
int osid; int osid;
@ -437,6 +435,11 @@ namespace EnvyUpdate
//relative url //relative url
gpuURL = "https://www.nvidia.com/Download/" + gpuURL; gpuURL = "https://www.nvidia.com/Download/" + gpuURL;
} }
else if (gpuURL.Contains("No certified downloads were found"))
{
//configuration not supported
throw new ArgumentException();
}
else else
{ {
//panic. //panic.