diff --git a/Src/LinkItem.cs b/Src/LinkItem.cs index fb991ee..4c7cb98 100644 --- a/Src/LinkItem.cs +++ b/Src/LinkItem.cs @@ -54,7 +54,8 @@ public static List Find(string file) RegexOptions.Singleline); if (m3.Success) { - Match m4 = Regex.Match(i.Href, "r/nvidia/comments/(.*)/driver_(.*?)_faq(discussion_thread)?", RegexOptions.Singleline); + + Match m4 = Regex.Match(i.Href, "r/nvidia/comments/(.*)/(|game_ready_)(|studio_)driver_(.*?)_faq(discussion_thread)?", RegexOptions.Singleline); if (m4.Success) { #if DEBUG @@ -72,6 +73,7 @@ public static List Find(string file) { continue; } + // TODO: use "latest driver" when available: "found: 'latest driver faq/discussion thread'" #if DEBUG Console.WriteLine("Found '" + t + "'"); #endif @@ -80,15 +82,37 @@ public static List Find(string file) //if (t.Contains("Driver") && (t.Contains("Hotfix") || (t.Contains("FAQ/Discussion") && !t.Contains("Latest")))) if (t.Contains("driver ")) { + // TODO: cut off at first number instead t = t.Replace(" faq/discussion", ""); +#if DEBUG + Console.WriteLine("String Trim=> '" + t + "'"); +#endif t = t.Replace(" thread", ""); +#if DEBUG + Console.WriteLine("String Trim=> '" + t + "'"); +#endif t = t.Replace("driver ", ""); - #if DEBUG - Console.WriteLine("Found Thread =>'" + t + "'"); + Console.WriteLine("String Trim=> '" + t + "'"); +#endif + t = t.Replace("& ", ""); +#if DEBUG + Console.WriteLine("String Trim=> '" + t + "'"); +#endif + t = t.Replace("studio ", ""); +#if DEBUG + Console.WriteLine("String Trim=> '" + t + "'"); #endif + t = t.Replace("game ready", ""); + i.Href = i.Href.Trim(); + + // Sometimes Trim fails + t = t.Replace(" ", ""); i.Text = t; +#if DEBUG + Console.WriteLine("Found Thread =>'" + t + "'"); +#endif #if DEBUG Console.WriteLine("Adding '" + t + "' (" + i.Href + ")"); #endif diff --git a/Src/OptionContainer.cs b/Src/OptionContainer.cs index 5c87026..a2d5b1b 100644 --- a/Src/OptionContainer.cs +++ b/Src/OptionContainer.cs @@ -60,6 +60,9 @@ public class OptionContainer public static Option DeleteDownloaded = new Option("--keep", "-k", false, "Delete the downloaded driver before exiting the program."); + public static Option Studio = new Option("--studio", "-S", false, + "Use the NVIDIA Studio driver where available. Uses the GameReady driver otherwise."); + public static Option Strip = new Option("--strip", "-x", false, "Attempt to strip all components deemed useless by this tool's developer(s)."); diff --git a/Src/Program.cs b/Src/Program.cs index 9ec409b..b27a051 100644 --- a/Src/Program.cs +++ b/Src/Program.cs @@ -250,8 +250,6 @@ private static bool DownloadDriver(string url, string version, out string downlo } else { - // http://us.download.nvidia.com/Windows/398.82/398.82-desktop-win10-64bit-international-whql.exe - // http://us.download.nvidia.com/Windows/398.86/398.86-desktop-win10-64bit-international-whql.exe <= invalid Console.WriteLine("Downloading Driver version " + version #if DEBUG + " from " + url + Environment.NewLine + "to " + newFile @@ -507,12 +505,15 @@ private static void MainProgramLoop(string[] args) //latestDriver = StringToFloat(tempver); //#if !DEBUG Console.WriteLine(driverTitles.Last()); -//#endif + //#endif // Build new URL from latest version // Note: '388.00' becomes '388' somewhere above, need to add '.00' at the end if trying to use that one. - // http://us.download.nvidia.com/Windows/397.93/397.93-desktop-win10-64bit-international-whql.exe - string DownloadURL = String.Format("http://us.download.nvidia.com/Windows/{0}/{0:#.##}-desktop-win10-64bit-international-whql.exe", latestDriver); + // http://us.download.nvidia.com/Windows/398.82/398.82-desktop-win10-64bit-international-whql.exe <= Valid + // http://us.download.nvidia.com/Windows/398.86/398.86-desktop-win10-64bit-international-whql.exe <= invalid + // http://us.download.nvidia.com/Windows/430.86/430.86-desktop-win10-64bit-international-nsd-whql.exe <= Studio Driver + // http://us.download.nvidia.com/Windows/430.86/430.86-desktop-win10-64bit-international-whql.exe <= GameReady Driver + string DownloadURL = String.Format("http://us.download.nvidia.com/Windows/{0}/{0:#.##}-desktop-win10-64bit-international-{1}whql.exe", latestDriver, OptionContainer.Studio ? "-nds":""); string downloadedFile = ""; bool needsDownload = IsOutOfDate(latestDriver); if (needsDownload) diff --git a/Src/Properties/AssemblyInfo.cs b/Src/Properties/AssemblyInfo.cs index 5ef1b59..8b76b1f 100644 --- a/Src/Properties/AssemblyInfo.cs +++ b/Src/Properties/AssemblyInfo.cs @@ -32,6 +32,6 @@ // 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("1.0.0.0")] +[assembly: AssemblyVersion("0.0.3.0")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: NeutralResourcesLanguage("en")] \ No newline at end of file