diff --git a/EnvyUpdate.sln b/EnvyUpdate.sln
new file mode 100644
index 0000000..6878393
--- /dev/null
+++ b/EnvyUpdate.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29411.108
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnvyUpdate", "EnvyUpdate\EnvyUpdate.csproj", "{1BF2468D-9579-462D-9153-4836E9C8721F}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {1BF2468D-9579-462D-9153-4836E9C8721F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1BF2468D-9579-462D-9153-4836E9C8721F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1BF2468D-9579-462D-9153-4836E9C8721F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1BF2468D-9579-462D-9153-4836E9C8721F}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {420FF0E8-D617-4002-AE19-8D9C50016CC7}
+ EndGlobalSection
+EndGlobal
diff --git a/EnvyUpdate/App.config b/EnvyUpdate/App.config
new file mode 100644
index 0000000..56efbc7
--- /dev/null
+++ b/EnvyUpdate/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/EnvyUpdate/App.xaml b/EnvyUpdate/App.xaml
new file mode 100644
index 0000000..414c0d4
--- /dev/null
+++ b/EnvyUpdate/App.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/EnvyUpdate/App.xaml.cs b/EnvyUpdate/App.xaml.cs
new file mode 100644
index 0000000..3e57067
--- /dev/null
+++ b/EnvyUpdate/App.xaml.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace EnvyUpdate
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : Application
+ {
+ }
+}
diff --git a/EnvyUpdate/EnvyUpdate.csproj b/EnvyUpdate/EnvyUpdate.csproj
new file mode 100644
index 0000000..4a0ab73
--- /dev/null
+++ b/EnvyUpdate/EnvyUpdate.csproj
@@ -0,0 +1,141 @@
+
+
+
+
+
+ Debug
+ AnyCPU
+ {1BF2468D-9579-462D-9153-4836E9C8721F}
+ WinExe
+ EnvyUpdate
+ EnvyUpdate
+ v4.7.2
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+ true
+ true
+
+
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+ icon.ico
+
+
+ false
+
+
+
+ ..\packages\Costura.Fody.4.1.0\lib\net40\Costura.dll
+
+
+ ..\packages\Hardcodet.NotifyIcon.Wpf.1.0.8\lib\net451\Hardcodet.Wpf.TaskbarNotification.dll
+
+
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ App.xaml
+ Code
+
+
+ MainWindow.xaml
+ Code
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {F935DC20-1CF0-11D0-ADB9-00C04FD58A0B}
+ 1
+ 0
+ 0
+ tlbimp
+ False
+ True
+
+
+
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
+
+
\ No newline at end of file
diff --git a/EnvyUpdate/FodyWeavers.xml b/EnvyUpdate/FodyWeavers.xml
new file mode 100644
index 0000000..a5dcf04
--- /dev/null
+++ b/EnvyUpdate/FodyWeavers.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/EnvyUpdate/FodyWeavers.xsd b/EnvyUpdate/FodyWeavers.xsd
new file mode 100644
index 0000000..44a5374
--- /dev/null
+++ b/EnvyUpdate/FodyWeavers.xsd
@@ -0,0 +1,111 @@
+
+
+
+
+
+
+
+
+
+
+
+ A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks
+
+
+
+
+ A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.
+
+
+
+
+ A list of unmanaged 32 bit assembly names to include, delimited with line breaks.
+
+
+
+
+ A list of unmanaged 64 bit assembly names to include, delimited with line breaks.
+
+
+
+
+ The order of preloaded assemblies, delimited with line breaks.
+
+
+
+
+
+ This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file.
+
+
+
+
+ Controls if .pdbs for reference assemblies are also embedded.
+
+
+
+
+ Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option.
+
+
+
+
+ As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off.
+
+
+
+
+ Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code.
+
+
+
+
+ Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior.
+
+
+
+
+ A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with |
+
+
+
+
+ A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |.
+
+
+
+
+ A list of unmanaged 32 bit assembly names to include, delimited with |.
+
+
+
+
+ A list of unmanaged 64 bit assembly names to include, delimited with |.
+
+
+
+
+ The order of preloaded assemblies, delimited with |.
+
+
+
+
+
+
+
+ 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.
+
+
+
+
+ A comma-separated list of error codes that can be safely ignored in assembly verification.
+
+
+
+
+ 'false' to turn off automatic generation of the XML Schema file.
+
+
+
+
+
\ No newline at end of file
diff --git a/EnvyUpdate/MainWindow.xaml b/EnvyUpdate/MainWindow.xaml
new file mode 100644
index 0000000..4137ab0
--- /dev/null
+++ b/EnvyUpdate/MainWindow.xaml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EnvyUpdate/MainWindow.xaml.cs b/EnvyUpdate/MainWindow.xaml.cs
new file mode 100644
index 0000000..832e83a
--- /dev/null
+++ b/EnvyUpdate/MainWindow.xaml.cs
@@ -0,0 +1,229 @@
+using System;
+using System.Windows;
+using System.Windows.Shapes;
+using System.IO;
+using System.Net;
+using System.Text.RegularExpressions;
+using System.Windows.Media;
+using System.Windows.Threading;
+
+namespace EnvyUpdate
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ string localDriv = null;
+ string onlineDriv = null;
+ readonly string appdata = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\envyupdate\\";
+ readonly string startup = Environment.GetFolderPath(Environment.SpecialFolder.Startup);
+ string gpuURL = null;
+ readonly string exeloc = System.Reflection.Assembly.GetEntryAssembly().Location;
+ bool isAtStartup = false;
+
+ public MainWindow()
+ {
+ InitializeComponent();
+ if (!Directory.Exists(appdata))
+ {
+ Directory.CreateDirectory(appdata);
+ }
+
+ // A bit of a hacky way to know if running the autostarted version or the regular one.
+ if (System.AppDomain.CurrentDomain.FriendlyName == "EnvyUpdateInstalled.exe")
+ {
+ WindowState = WindowState.Minimized;
+ Hide();
+ isAtStartup = true;
+ }
+
+ if (Util.GetLocDriv() != null)
+ {
+ localDriv = Util.GetLocDriv();
+ textblockGPU.Text = localDriv;
+ }
+ else
+ {
+ MessageBox.Show("No NVIDIA GPU found. Application will exit.");
+ System.Windows.Application.Current.Shutdown();
+ }
+ if (File.Exists(appdata + "nvidia-update.txt"))
+ {
+ chkPortable.IsChecked = false;
+ DispatcherTimer Dt = new DispatcherTimer();
+ Dt.Tick += new EventHandler(Dt_Tick);
+ Dt.Interval = new TimeSpan(5, 0, 0);
+ Dt.Start();
+ Load();
+ }
+ if (File.Exists(startup + "\\EnvyUpdate.lnk"))
+ {
+ chkAutostart.IsChecked = true;
+ }
+ }
+
+ private void Dt_Tick(object sender, EventArgs e)
+ {
+ Load();
+ if (textblockOnline.Foreground == Brushes.Red)
+ {
+ Show();
+ WindowState = WindowState.Normal;
+ }
+ }
+
+ private void buttonHelp_Click(object sender, RoutedEventArgs e)
+ {
+ System.Diagnostics.Process.Start("https://github.com/fyr77/EnvyUpdate/");
+ }
+
+ private void Grid_Drop(object sender, DragEventArgs e)
+ {
+ if (e.Data.GetDataPresent(DataFormats.FileDrop))
+ {
+ try
+ {
+ string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
+ Load(files);
+ }
+ catch (WebException)
+ {
+ MessageBox.Show("Network Error. Are you connected to the internet?", "Network Error");
+ }
+ }
+ }
+ private void Load()
+ {
+ FileInfo f = new FileInfo(appdata + "nvidia-update.txt");
+
+ int psid;
+ int pfid;
+ int osid;
+ int langid;
+
+ chkPortable.Visibility = Visibility.Hidden;
+ labelDrag.Content = "Drag nvidia.com-cookies.txt here if you have changed your graphics card.";
+ psid = Util.GetData(f.FullName, "ProductSeries");
+ pfid = Util.GetData(f.FullName, "ProductType");
+ osid = Util.GetData(f.FullName, "OperatingSystem");
+ langid = Util.GetData(f.FullName, "Language");
+ gpuURL = "http://www.nvidia.com/Download/processDriver.aspx?psid=" + psid.ToString() + "&pfid=" + pfid.ToString() + "&rpf=1&osid=" + osid.ToString() + "&lid=" + langid.ToString() + "&ctk=0";
+ WebClient c = new WebClient();
+ gpuURL = c.DownloadString(gpuURL);
+ string pContent = c.DownloadString(gpuURL);
+ var pattern = @"\d{3}\.\d{2}";
+ Regex rgx = new Regex(pattern);
+ var matches = rgx.Matches(pContent);
+ onlineDriv = Convert.ToString(matches[0]);
+ textblockOnline.Text = onlineDriv;
+ c.Dispose();
+
+ if (localDriv != onlineDriv)
+ {
+ textblockOnline.Foreground = Brushes.Red;
+ buttonDL.Visibility = Visibility.Visible;
+ if (isAtStartup)
+ {
+ Show();
+ WindowState = WindowState.Normal;
+ }
+ }
+ else
+ textblockOnline.Foreground = Brushes.Green;
+ }
+ private void Load(string[] files)
+ {
+ FileInfo f = new FileInfo(files[0]);
+
+ int psid;
+ int pfid;
+ int osid;
+ int langid;
+
+ if (chkPortable.IsChecked == false)
+ {
+ File.Copy(f.FullName, appdata + "nvidia-update.txt", true);
+ f = new FileInfo(appdata + "nvidia-update.txt");
+
+ chkPortable.Visibility = Visibility.Hidden;
+ labelDrag.Content = "Drag nvidia.com-cookies.txt here if you have changed your graphics card.";
+ }
+ psid = Util.GetData(f.FullName, "ProductSeries");
+ pfid = Util.GetData(f.FullName, "ProductType");
+ osid = Util.GetData(f.FullName, "OperatingSystem");
+ langid = Util.GetData(f.FullName, "Language");
+ gpuURL = "http://www.nvidia.com/Download/processDriver.aspx?psid=" + psid.ToString() + "&pfid=" + pfid.ToString() + "&rpf=1&osid=" + osid.ToString() + "&lid=" + langid.ToString() + "&ctk=0";
+ WebClient c = new WebClient();
+ gpuURL = c.DownloadString(gpuURL);
+ string pContent = c.DownloadString(gpuURL);
+ var pattern = @"\d{3}\.\d{2}";
+ Regex rgx = new Regex(pattern);
+ var matches = rgx.Matches(pContent);
+ onlineDriv = Convert.ToString(matches[0]);
+ textblockOnline.Text = onlineDriv;
+ c.Dispose();
+
+ if (localDriv != onlineDriv)
+ {
+ textblockOnline.Foreground = Brushes.Red;
+ buttonDL.Visibility = Visibility.Visible;
+ }
+ else
+ textblockOnline.Foreground = Brushes.Green;
+ }
+ private void buttonDL_Click(object sender, RoutedEventArgs e)
+ {
+ System.Diagnostics.Process.Start(gpuURL);
+ }
+
+ private void TaskbarIcon_TrayLeftMouseDown(object sender, RoutedEventArgs e)
+ {
+ Show();
+ WindowState = WindowState.Normal;
+ }
+
+ private void Window_StateChanged(object sender, EventArgs e)
+ {
+ if (WindowState == WindowState.Minimized)
+ {
+ Hide();
+ }
+ }
+
+ private void chkPortable_Unchecked(object sender, RoutedEventArgs e)
+ {
+ if (chkAutostart != null)
+ {
+ chkAutostart.IsEnabled = true;
+ }
+ }
+
+ private void chkPortable_Checked(object sender, RoutedEventArgs e)
+ {
+ if (chkAutostart != null)
+ {
+ chkAutostart.IsEnabled = false;
+ chkAutostart.IsChecked = false;
+ }
+ }
+
+ private void chkAutostart_Checked(object sender, RoutedEventArgs e)
+ {
+ File.Copy(exeloc, appdata + "EnvyUpdateInstalled.exe", true);
+ Util.CreateShortcut("EnvyUpdate", startup, appdata + "EnvyUpdateInstalled.exe", "Nvidia Updater Application.");
+ }
+
+ private void chkAutostart_Unchecked(object sender, RoutedEventArgs e)
+ {
+ File.Delete(appdata + "EnvyUpdateInstalled.exe");
+ File.Delete(startup + "\\EnvyUpdate.lnk");
+ }
+
+ private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
+ {
+ var window = MessageBox.Show("Exit EnvyUpdate?", "", MessageBoxButton.YesNo);
+ e.Cancel = (window == MessageBoxResult.No);
+ }
+ }
+}
diff --git a/EnvyUpdate/Properties/AssemblyInfo.cs b/EnvyUpdate/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..1afbe89
--- /dev/null
+++ b/EnvyUpdate/Properties/AssemblyInfo.cs
@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("EnvyUpdate")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("EnvyUpdate")]
+[assembly: AssemblyCopyright("Copyright © 2019")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+//In order to begin building localizable applications, set
+//CultureYouAreCodingWith in your .csproj file
+//inside a . For example, if you are using US english
+//in your source files, set the to en-US. Then uncomment
+//the NeutralResourceLanguage attribute below. Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
+
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// 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: AssemblyFileVersion("1.0.0.0")]
diff --git a/EnvyUpdate/Properties/Resources.Designer.cs b/EnvyUpdate/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..dfd994e
--- /dev/null
+++ b/EnvyUpdate/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace EnvyUpdate.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("EnvyUpdate.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/EnvyUpdate/Properties/Resources.resx b/EnvyUpdate/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/EnvyUpdate/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/EnvyUpdate/Properties/Settings.Designer.cs b/EnvyUpdate/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..0585bd8
--- /dev/null
+++ b/EnvyUpdate/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace EnvyUpdate.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/EnvyUpdate/Properties/Settings.settings b/EnvyUpdate/Properties/Settings.settings
new file mode 100644
index 0000000..033d7a5
--- /dev/null
+++ b/EnvyUpdate/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/EnvyUpdate/Util.cs b/EnvyUpdate/Util.cs
new file mode 100644
index 0000000..3854fd3
--- /dev/null
+++ b/EnvyUpdate/Util.cs
@@ -0,0 +1,90 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Management;
+using System.Net;
+using System.IO;
+using IWshRuntimeLibrary;
+
+namespace EnvyUpdate
+{
+ class Util
+ {
+ ///
+ /// Parses GPU info from a cookie file
+ ///
+ ///
+ ///
+ ///
+ public static int GetData(string path, string term)
+ {
+ string found = null;
+ string line;
+ using (StreamReader file = new StreamReader(path))
+ {
+ while ((line = file.ReadLine()) != null)
+ {
+ if (line.Contains(term))
+ {
+ found = line;
+ break;
+ }
+ }
+ }
+ int lastno = Convert.ToInt32(found.Split().Last());
+ return lastno;
+ }
+ ///
+ /// Gets local driver version.
+ ///
+ ///
+ public static string GetLocDriv()
+ {
+ bool foundGpu = false;
+ string OfflineGPUVersion = null;
+
+ // query local driver version
+ try
+ {
+ foreach (ManagementObject obj in new ManagementObjectSearcher("SELECT * FROM Win32_VideoController").Get())
+ {
+ if (obj["Description"].ToString().ToLower().Contains("nvidia"))
+ {
+ OfflineGPUVersion = obj["DriverVersion"].ToString().Replace(".", string.Empty).Substring(5);
+ OfflineGPUVersion = OfflineGPUVersion.Substring(0, 3) + "." + OfflineGPUVersion.Substring(3); // add dot
+ foundGpu = true;
+ break;
+ }
+ }
+
+ if (!foundGpu)
+ throw new InvalidDataException();
+
+ return OfflineGPUVersion;
+ }
+ catch (InvalidDataException)
+ {
+ return null;
+ }
+ }
+ ///
+ /// Creates a standard Windows shortcut.
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static void CreateShortcut(string shortcutName, string shortcutPath, string targetFileLocation, string description)
+ {
+ string shortcutLocation = System.IO.Path.Combine(shortcutPath, shortcutName + ".lnk");
+ WshShell shell = new WshShell();
+ IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(shortcutLocation);
+
+ shortcut.Description = description;
+ shortcut.TargetPath = targetFileLocation;
+ shortcut.Save();
+ }
+ }
+}
diff --git a/EnvyUpdate/icon.ico b/EnvyUpdate/icon.ico
new file mode 100644
index 0000000..44d9430
Binary files /dev/null and b/EnvyUpdate/icon.ico differ
diff --git a/EnvyUpdate/icon.png b/EnvyUpdate/icon.png
new file mode 100644
index 0000000..94e6829
Binary files /dev/null and b/EnvyUpdate/icon.png differ
diff --git a/EnvyUpdate/packages.config b/EnvyUpdate/packages.config
new file mode 100644
index 0000000..68a097f
--- /dev/null
+++ b/EnvyUpdate/packages.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
index 008290d..6e8b817 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,13 @@
# EnvyUpdate
- Small update checker application for Nvidia GPUs
+ A small update checker application for Nvidia GPUs
+
+ ## How to use
+
+ 1. Download the [latest release](https://github.com/fyr77/EnvyUpdate/releases/latest/download/EnvyUpdate.exe) and run it. Windows SmartScreen Messages can be safely ignored. They only happen because this project is not digitally signed.
+ 2. If you want to use the application without saving any settings to your drive, keep the "Portable mode" checkbox checked. Otherwise uncheck it to automatically save your configuration.
+ 3. Install the cookie-txt addon for [Firefox](https://addons.mozilla.org/en-US/firefox/addon/cookies-txt-one-click/) or [Chrome](https://chrome.google.com/webstore/detail/cookiestxt/njabckikapfpffapmjgojcnbfjonfjfg).
+ 4. Go to the [Nvidia driver download page](https://www.nvidia.com/Download/index.aspx), enter your graphics card model, operating system, etc. and click "Search".
+ 5. On the resulting page, use the previously installed cookie-txt addon to save your site cookies as a .txt file.
+ 6. Drag this .txt file into the corresponding space inside EnvyUpdate.
+ 7. If everything works correctly, the online driver version should be displayed in the application window.
+ 8. When not in portable mode, you may activate Autostart. This will make the application start everytime Windows boots. This will also install the application itself in your APPDATA folder.
\ No newline at end of file