fix for new Nvidia links

This commit is contained in:
Jakob 2022-11-04 17:03:45 +01:00
parent cc4f7b19f6
commit f86025f63d
4 changed files with 14 additions and 2 deletions

File diff suppressed because one or more lines are too long

View file

@ -151,6 +151,7 @@ namespace EnvyUpdate
} }
//Temporary Studio Driver override logic until I have figured out how to detect it automatically //Temporary Studio Driver override logic until I have figured out how to detect it automatically
//TODO
try try
{ {
if (radioSD.IsChecked == true) if (radioSD.IsChecked == true)
@ -164,6 +165,11 @@ namespace EnvyUpdate
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(); 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(); WebClient c = new WebClient();
gpuURL = c.DownloadString(gpuURL); gpuURL = c.DownloadString(gpuURL);
if (!gpuURL.Contains("://"))
{
//This means a relative link was used.
gpuURL = "https://www.nvidia.com/Download/" + gpuURL;
}
string pContent = c.DownloadString(gpuURL); string pContent = c.DownloadString(gpuURL);
var pattern = @"Windows\/\d{3}\.\d{2}"; var pattern = @"Windows\/\d{3}\.\d{2}";
Regex rgx = new Regex(pattern); Regex rgx = new Regex(pattern);

View file

@ -385,5 +385,11 @@ namespace EnvyUpdate
return 1; return 1;
} }
public static void DownloadFile(string fileURL, string savePath)
{
//TODO Implement downloading
//TODO implement progress bar
}
} }
} }

View file

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2021 Jakob Senkl Copyright (c) 2019-2022 Jakob Senkl
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal