diff --git a/EnvyUpdate/App.xaml b/EnvyUpdate/App.xaml
index 414c0d4..de53160 100644
--- a/EnvyUpdate/App.xaml
+++ b/EnvyUpdate/App.xaml
@@ -2,8 +2,14 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:EnvyUpdate"
+ xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
StartupUri="MainWindow.xaml">
-
+
+
+
+
+
+
diff --git a/EnvyUpdate/DashboardPage.xaml b/EnvyUpdate/DashboardPage.xaml
new file mode 100644
index 0000000..b9572ba
--- /dev/null
+++ b/EnvyUpdate/DashboardPage.xaml
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EnvyUpdate/DashboardPage.xaml.cs b/EnvyUpdate/DashboardPage.xaml.cs
new file mode 100644
index 0000000..abb0b90
--- /dev/null
+++ b/EnvyUpdate/DashboardPage.xaml.cs
@@ -0,0 +1,415 @@
+using Microsoft.Build.Framework.XamlTypes;
+using Microsoft.Toolkit.Uwp.Notifications;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Threading;
+using Windows.ApplicationModel.VoiceCommands;
+
+namespace EnvyUpdate
+{
+ ///
+ /// Interaction logic for Dashboard.xaml
+ ///
+ public partial class DashboardPage
+ {
+ private string localDriv = null;
+ private string onlineDriv = null;
+ private string gpuURL = null;
+ private string skippedVer = null;
+ private string[] arguments = null;
+
+ public DashboardPage()
+ {
+ InitializeComponent();
+
+ // Try to get command line arguments
+ try
+ {
+ arguments = Environment.GetCommandLineArgs();
+ }
+ catch (IndexOutOfRangeException)
+ {
+ // This is necessary, since .NET throws an exception if you check for a non-existant arg.
+ }
+
+ // Delete installed legacy versions
+ if (Directory.Exists(GlobalVars.appdata))
+ {
+ Debug.LogToFile("INFO Found old appdata installation, uninstalling.");
+ UninstallAll();
+ }
+
+ localDriv = Util.GetLocDriv();
+
+ Debug.LogToFile("INFO Local driver version: " + localDriv);
+
+ if (localDriv != null)
+ {
+ Debug.LogToFile("INFO Local driver version already known, updating info without reloading.");
+ UpdateLocalVer(false);
+ }
+ else
+ {
+ if (arguments.Contains("/fake"))
+ {
+ Debug.isFake = true;
+ Debug.LogToFile("WARN Faking GPU with debug info.");
+ }
+ else
+ {
+ Debug.LogToFile("FATAL No supported GPU found, terminating.");
+ MessageBox.Show(Properties.Resources.no_compatible_gpu);
+ Environment.Exit(255);
+ }
+ }
+
+ Debug.LogToFile("INFO Detecting driver type.");
+
+ if (Util.IsDCH())
+ textblockLocalType.Text = "DCH";
+ else if (Debug.isFake)
+ textblockLocalType.Text = "DCH (Debug)";
+ else
+ textblockLocalType.Text = "Standard";
+
+ Debug.LogToFile("INFO Done detecting driver type: " + textblockLocalType.Text);
+
+ // Check for startup shortcut
+ if (File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "EnvyUpdate.lnk")))
+ {
+ Debug.LogToFile("INFO Autostart is enabled.");
+ switchAutostart.IsChecked = true;
+ switchAutostart_Click(null, null); //Automatically recreate shortcut to account for moved EXE.
+ }
+
+ DispatcherTimer Dt = new DispatcherTimer();
+ Dt.Tick += new EventHandler(Dt_Tick);
+ // Check for new updates every 5 hours.
+ Dt.Interval = new TimeSpan(5, 0, 0);
+ Dt.Start();
+ Debug.LogToFile("INFO Started check timer.");
+
+ string watchDirPath = Path.Combine(Environment.ExpandEnvironmentVariables("%ProgramW6432%"), "NVIDIA Corporation\\Installer2\\InstallerCore");
+ if (Directory.Exists(watchDirPath))
+ {
+ GlobalVars.monitoringInstall = true;
+
+ var driverFileChangedWatcher = new FileSystemWatcher(watchDirPath);
+ driverFileChangedWatcher.NotifyFilter = NotifyFilters.Attributes
+ | NotifyFilters.CreationTime
+ | NotifyFilters.FileName
+ | NotifyFilters.LastAccess
+ | NotifyFilters.LastWrite
+ | NotifyFilters.Size;
+ driverFileChangedWatcher.Changed += DriverFileChanged;
+
+ driverFileChangedWatcher.Filter = "*.dll";
+ driverFileChangedWatcher.IncludeSubdirectories = false;
+ driverFileChangedWatcher.EnableRaisingEvents = true;
+ Debug.LogToFile("INFO Started update file system watcher.");
+ }
+
+ Load();
+ }
+
+ private void Dt_Tick(object sender, EventArgs e)
+ {
+ Load();
+ }
+
+ private void Load()
+ {
+ if (Util.GetDTID() == 18)
+ {
+ Debug.LogToFile("INFO Found studio driver.");
+ switchStudioDriver.IsChecked = true;
+ }
+ else
+ {
+ Debug.LogToFile("INFO Found standard driver.");
+ switchStudioDriver.IsChecked = false;
+ }
+
+ if (File.Exists(GlobalVars.exedirectory + "skip.envy"))
+ {
+ Debug.LogToFile("INFO Found version skip config.");
+ skippedVer = File.ReadLines(GlobalVars.exedirectory + "skip.envy").First();
+ }
+
+ // This little bool check is necessary for debug mode on systems without an Nvidia GPU.
+ if (Debug.isFake)
+ {
+ localDriv = Debug.LocalDriv();
+ cardLocal.Header = localDriv;
+ textblockGPUName.Text = Debug.GPUname();
+ }
+
+ try
+ {
+ Debug.LogToFile("INFO Trying to get GPU update URL.");
+ gpuURL = Util.GetGpuUrl();
+ }
+ catch (ArgumentException)
+ {
+ Debug.LogToFile("WARN Could not get GPU update URL, trying again with non-studio driver.");
+ try
+ {
+ // disable SD and try with GRD
+ if (File.Exists(GlobalVars.exedirectory + "sd.envy"))
+ {
+ File.Delete(GlobalVars.exedirectory + "sd.envy");
+ }
+
+ gpuURL = Util.GetGpuUrl(); //try again with GRD
+ MessageBox.Show(Properties.Resources.ui_studionotsupported);
+ switchStudioDriver.IsChecked = false;
+ }
+ catch (ArgumentNullException)
+ {
+ MessageBox.Show("ERROR: Could not get list of GPU models from Nvidia, please check your network connection.\nOtherwise, please report this issue on GitHub.");
+ Environment.Exit(11);
+ }
+ catch (ArgumentException e)
+ {
+ // Now we have a problem.
+ Debug.LogToFile("FATAL Invalid API response from Nvidia. Attempted API call: " + e.Message);
+ MessageBox.Show("ERROR: Invalid API response from Nvidia. Please file an issue on GitHub.\nAttempted API call:\n" + e.Message);
+ Environment.Exit(10);
+ }
+ }
+
+ using (var c = new WebClient())
+ {
+ Debug.LogToFile("INFO Trying to get newest driver version.");
+ string pContent = c.DownloadString(gpuURL);
+ var pattern = @"Windows\/\d{3}\.\d{2}";
+ Regex rgx = new Regex(pattern);
+ var matches = rgx.Matches(pContent);
+ onlineDriv = Regex.Replace(Convert.ToString(matches[0]), "Windows/", "");
+ cardOnline.Header = onlineDriv;
+ Debug.LogToFile("INFO Got online driver version: " + onlineDriv);
+ }
+
+ try
+ {
+ if (float.Parse(localDriv) < float.Parse(onlineDriv))
+ {
+ Debug.LogToFile("INFO Local version is older than online. Setting UI...");
+ SetInfoBar(false);
+ buttonDownload.Visibility = Visibility.Visible;
+ if (skippedVer == null)
+ {
+ buttonSkipVersion.ToolTip = Properties.Resources.ui_skipversion;
+ buttonSkipVersion.IsEnabled = true;
+ buttonSkipVersion.Visibility = Visibility.Visible;
+ }
+ else
+ {
+ buttonSkipVersion.IsEnabled = true;
+ buttonSkipVersion.ToolTip = Properties.Resources.ui_skipped;
+ }
+
+ Debug.LogToFile("INFO UI set.");
+
+ if (skippedVer != onlineDriv)
+ {
+ Debug.LogToFile("INFO Showing update popup notification.");
+ Notify.ShowDrivUpdatePopup();
+ }
+ }
+ else
+ {
+ Debug.LogToFile("INFO Local version is up to date.");
+ buttonSkipVersion.Visibility = Visibility.Collapsed;
+ SetInfoBar(true);
+ }
+ }
+ catch (FormatException)
+ {
+ Debug.LogToFile("INFO Caught FormatException, assuming locale workaround is necessary.");
+ //Thank you locales. Some languages need , instead of . for proper parsing
+ string cLocalDriv = localDriv.Replace('.', ',');
+ string cOnlineDriv = onlineDriv.Replace('.', ',');
+ if (float.Parse(cLocalDriv) < float.Parse(cOnlineDriv))
+ {
+ Debug.LogToFile("INFO Local version is older than online. Setting UI...");
+ SetInfoBar(false);
+ buttonDownload.Visibility = Visibility.Visible;
+ if (skippedVer == null)
+ {
+ buttonSkipVersion.IsEnabled = true;
+ buttonSkipVersion.Visibility = Visibility.Visible;
+ }
+ else
+ {
+ buttonSkipVersion.IsEnabled = false;
+ buttonSkipVersion.ToolTip = Properties.Resources.ui_skipped;
+ }
+
+ if (skippedVer != onlineDriv)
+ {
+ Debug.LogToFile("INFO Showing update popup notification.");
+ Notify.ShowDrivUpdatePopup();
+ }
+ }
+ else
+ {
+ Debug.LogToFile("INFO Local version is up to date.");
+ buttonSkipVersion.Visibility = Visibility.Collapsed;
+ SetInfoBar(true);
+ }
+ }
+
+ //Check for different version than skipped version
+ if (skippedVer != null && skippedVer != onlineDriv)
+ {
+ Debug.LogToFile("INFO Skipped version is surpassed, deleting setting.");
+ skippedVer = null;
+ if (File.Exists(GlobalVars.exedirectory + "skip.envy"))
+ File.Delete(GlobalVars.exedirectory + "skip.envy");
+ buttonSkipVersion.ToolTip = Properties.Resources.ui_skipversion;
+ buttonSkipVersion.IsEnabled = true;
+ buttonSkipVersion.Visibility = Visibility.Visible;
+ }
+ }
+
+ private void buttonDL_Click(object sender, RoutedEventArgs e)
+ {
+ Debug.LogToFile("INFO Opening download page.");
+ Process.Start(gpuURL);
+ }
+
+ public void UninstallAll()
+ {
+ if (File.Exists(GlobalVars.startup + "\\EnvyUpdate.lnk"))
+ {
+ Debug.LogToFile("INFO Deleted startup entry.");
+ File.Delete(GlobalVars.startup + "\\EnvyUpdate.lnk");
+ }
+
+ if (File.Exists(GlobalVars.startmenu + "\\EnvyUpdate.lnk"))
+ {
+ Debug.LogToFile("INFO Deleted start menu entry.");
+ File.Delete(GlobalVars.startmenu + "\\EnvyUpdate.lnk");
+ }
+ if ((GlobalVars.exedirectory == GlobalVars.appdata) && File.Exists(GlobalVars.appdata + "EnvyUpdate.exe"))
+ {
+ Debug.LogToFile("INFO Deleting EnvyUpdate appdata and self.");
+ MessageBox.Show(Properties.Resources.uninstall_legacy_message);
+ Util.SelfDelete();
+ }
+ else if (Directory.Exists(GlobalVars.appdata))
+ {
+ Debug.LogToFile("INFO Deleting EnvyUpdate appdata folder");
+ Directory.Delete(GlobalVars.appdata, true);
+ }
+ }
+
+ private void radioGRD_Checked(object sender, RoutedEventArgs e)
+ {
+ if (File.Exists(GlobalVars.exedirectory + "sd.envy"))
+ {
+ Debug.LogToFile("INFO Switching to game ready driver.");
+ File.Delete(GlobalVars.exedirectory + "sd.envy");
+ Load();
+ }
+ }
+
+ private void radioSD_Checked(object sender, RoutedEventArgs e)
+ {
+ if (!File.Exists(GlobalVars.exedirectory + "sd.envy"))
+ {
+ Debug.LogToFile("INFO Switching to studio driver.");
+ File.Create(GlobalVars.exedirectory + "sd.envy").Close();
+ Load();
+ }
+ }
+
+ private void switchAutostart_Click(object sender, RoutedEventArgs e)
+ {
+ if (File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "EnvyUpdate.lnk")))
+ {
+ Debug.LogToFile("INFO Removing autostart entry.");
+ File.Delete(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "EnvyUpdate.lnk"));
+ }
+ if (switchAutostart.IsChecked == true)
+ {
+ Debug.LogToFile("INFO Creating autostart entry.");
+ Util.CreateShortcut("EnvyUpdate", Environment.GetFolderPath(Environment.SpecialFolder.Startup), GlobalVars.exeloc, "NVidia Update Checker", "/minimize");
+ }
+ }
+
+ private void buttonSkip_Click(object sender, RoutedEventArgs e)
+ {
+ Debug.LogToFile("INFO Skipping version.");
+ skippedVer = onlineDriv;
+ File.WriteAllText(GlobalVars.exedirectory + "skip.envy", onlineDriv);
+ buttonSkipVersion.IsEnabled = false;
+ buttonSkipVersion.ToolTip = Properties.Resources.ui_skipped;
+ MessageBox.Show(Properties.Resources.skip_confirm);
+ }
+
+ private void UpdateLocalVer(bool reloadLocalDriv = true)
+ {
+ Debug.LogToFile("INFO Updating local driver version in UI.");
+ if (reloadLocalDriv)
+ {
+ Debug.LogToFile("INFO Reloading local driver version.");
+ localDriv = Util.GetLocDriv();
+ }
+ cardLocal.Header = localDriv;
+ if (GlobalVars.isMobile)
+ textblockGPUName.Text = Util.GetGPUName(false) + " (mobile)";
+ else
+ textblockGPUName.Text = Util.GetGPUName(false);
+ }
+
+ void DriverFileChanged(object sender, FileSystemEventArgs e)
+ {
+ Debug.LogToFile("INFO Watched driver file changed! Reloading data.");
+ System.Threading.Thread.Sleep(10000);
+ Application.Current.Dispatcher.Invoke(delegate
+ {
+ UpdateLocalVer();
+ Load();
+ });
+ }
+
+ private void CardOnline_Click(object sender, RoutedEventArgs e)
+ {
+ Debug.LogToFile("INFO Opening download page.");
+ Process.Start(gpuURL);
+ }
+
+ private void SetInfoBar (bool good)
+ {
+ if (good)
+ {
+ infoBarStatus.Severity = Wpf.Ui.Controls.InfoBarSeverity.Success;
+ infoBarStatus.Title = Properties.Resources.ui_info_uptodate;
+ infoBarStatus.Message = Properties.Resources.ui_message_good;
+ }
+ else
+ {
+ infoBarStatus.Severity = Wpf.Ui.Controls.InfoBarSeverity.Warning;
+ infoBarStatus.Title = Properties.Resources.ui_info_outdated;
+ infoBarStatus.Message = Properties.Resources.ui_message_update;
+ }
+ }
+ }
+}
diff --git a/EnvyUpdate/EnvyUpdate.csproj b/EnvyUpdate/EnvyUpdate.csproj
index b3e717f..ef59029 100644
--- a/EnvyUpdate/EnvyUpdate.csproj
+++ b/EnvyUpdate/EnvyUpdate.csproj
@@ -100,21 +100,25 @@
-
- InfoWindow.xaml
-
+
+ DashboardPage.xaml
+
+
+ True
+ True
+ Licenses.resx
+
Resources.de.resx
True
True
+
+ SettingsPage.xaml
+
-
- Designer
- MSBuild:Compile
-
MSBuild:Compile
Designer
@@ -127,6 +131,14 @@
MainWindow.xaml
Code
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
@@ -142,6 +154,10 @@
Settings.settings
True
+
+ ResXFileCodeGenerator
+ Licenses.Designer.cs
+
PublicResXFileCodeGenerator
Resources.de.Designer.cs
@@ -197,9 +213,6 @@
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
- 1.1.0
-
7.1.3
@@ -209,6 +222,9 @@
7.0.1
+
+ 2.0.3
+
\ No newline at end of file
diff --git a/EnvyUpdate/InfoWindow.xaml b/EnvyUpdate/InfoWindow.xaml
deleted file mode 100644
index e9d09c5..0000000
--- a/EnvyUpdate/InfoWindow.xaml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/EnvyUpdate/MainWindow.xaml b/EnvyUpdate/MainWindow.xaml
index 81f4d3d..d85a609 100644
--- a/EnvyUpdate/MainWindow.xaml
+++ b/EnvyUpdate/MainWindow.xaml
@@ -1,31 +1,63 @@
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/EnvyUpdate/MainWindow.xaml.cs b/EnvyUpdate/MainWindow.xaml.cs
index 07909e0..271996c 100644
--- a/EnvyUpdate/MainWindow.xaml.cs
+++ b/EnvyUpdate/MainWindow.xaml.cs
@@ -1,32 +1,29 @@
-using Microsoft.Toolkit.Uwp.Notifications;
+using Microsoft.Build.Framework.XamlTypes;
+using Microsoft.Toolkit.Uwp.Notifications;
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Management;
using System.Net;
+using System.Runtime.Remoting.Messaging;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Media;
using System.Windows.Threading;
+using Wpf.Ui.Controls.Interfaces;
namespace EnvyUpdate
{
///
/// Interaction logic for MainWindow.xaml
///
- public partial class MainWindow : Window
+ public partial class MainWindow
{
- private string localDriv = null;
- private string onlineDriv = null;
- private string gpuURL = null;
private string[] arguments = null;
- private string skippedVer = null;
public MainWindow()
{
- InitializeComponent();
-
// Try to get command line arguments
try
{
@@ -52,63 +49,11 @@ namespace EnvyUpdate
{
Debug.LogToFile("FATAL Found another instance, terminating.");
+
MessageBox.Show(Properties.Resources.instance_already_running);
Environment.Exit(1);
}
- // Delete installed legacy versions
- if (Directory.Exists(GlobalVars.appdata))
- {
- Debug.LogToFile("INFO Found old appdata installation, uninstalling.");
- UninstallAll();
- }
-
- GlobalVars.isMobile = Util.IsMobile();
- Debug.LogToFile("INFO Mobile: " + GlobalVars.isMobile);
-
- localDriv = Util.GetLocDriv();
-
- Debug.LogToFile("INFO Local driver version: " + localDriv);
-
- if (localDriv != null)
- {
- Debug.LogToFile("INFO Local driver version already known, updating info without reloading.");
- UpdateLocalVer(false);
- }
- else
- {
- if (arguments.Contains("/fake"))
- {
- Debug.isFake = true;
- Debug.LogToFile("WARN Faking GPU with debug info.");
- }
- else
- {
- Debug.LogToFile("FATAL No supported GPU found, terminating.");
- MessageBox.Show(Properties.Resources.no_compatible_gpu);
- Environment.Exit(255);
- }
- }
-
- Debug.LogToFile("INFO Detecting driver type.");
-
- if (Util.IsDCH())
- textblockLocalType.Text = "DCH";
- else if (Debug.isFake)
- textblockLocalType.Text = "DCH (Debug)";
- else
- textblockLocalType.Text = "Standard";
-
- Debug.LogToFile("INFO Done detecting driver type: " + textblockLocalType.Text);
-
- // Check for startup shortcut
- if (File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "EnvyUpdate.lnk")))
- {
- Debug.LogToFile("INFO Autostart is enabled.");
- chkAutostart.IsChecked = true;
- chkAutostart_Click(null, null); //Automatically recreate shortcut to account for moved EXE.
- }
-
//Check if launched as miminized with arg
if (arguments.Contains("/minimize"))
{
@@ -117,204 +62,14 @@ namespace EnvyUpdate
Hide();
}
- DispatcherTimer Dt = new DispatcherTimer();
- Dt.Tick += new EventHandler(Dt_Tick);
- // Check for new updates every 5 hours.
- Dt.Interval = new TimeSpan(5, 0, 0);
- Dt.Start();
- Debug.LogToFile("INFO Started check timer.");
+ GlobalVars.isMobile = Util.IsMobile();
+ Debug.LogToFile("INFO Mobile: " + GlobalVars.isMobile);
- string watchDirPath = Path.Combine(Environment.ExpandEnvironmentVariables("%ProgramW6432%"), "NVIDIA Corporation\\Installer2\\InstallerCore");
- if (Directory.Exists(watchDirPath))
- {
- GlobalVars.monitoringInstall = true;
+ InitializeComponent();
+ Wpf.Ui.Appearance.Accent.ApplySystemAccent();
- var driverFileChangedWatcher = new FileSystemWatcher(watchDirPath);
- driverFileChangedWatcher.NotifyFilter = NotifyFilters.Attributes
- | NotifyFilters.CreationTime
- | NotifyFilters.FileName
- | NotifyFilters.LastAccess
- | NotifyFilters.LastWrite
- | NotifyFilters.Size;
- driverFileChangedWatcher.Changed += DriverFileChanged;
-
- driverFileChangedWatcher.Filter = "*.dll";
- driverFileChangedWatcher.IncludeSubdirectories = false;
- driverFileChangedWatcher.EnableRaisingEvents = true;
- Debug.LogToFile("INFO Started update file system watcher.");
- }
-
- Load();
+
}
-
- private void Dt_Tick(object sender, EventArgs e)
- {
- Load();
- }
-
- private void buttonHelp_Click(object sender, RoutedEventArgs e)
- {
- Debug.LogToFile("INFO Showing info window.");
- InfoWindow infoWin = new InfoWindow();
- infoWin.ShowDialog();
- }
-
- private void Load()
- {
- if (Util.GetDTID() == 18)
- {
- Debug.LogToFile("INFO Found studio driver.");
- radioSD.IsChecked = true;
- }
- else
- {
- Debug.LogToFile("INFO Found standard driver.");
- radioGRD.IsChecked = true;
- }
-
- if (File.Exists(GlobalVars.exedirectory + "skip.envy"))
- {
- Debug.LogToFile("INFO Found version skip config.");
- skippedVer = File.ReadLines(GlobalVars.exedirectory + "skip.envy").First();
- }
-
- // This little bool check is necessary for debug mode on systems without an Nvidia GPU.
- if (Debug.isFake)
- {
- localDriv = Debug.LocalDriv();
- textblockGPU.Text = localDriv;
- textblockGPUName.Text = Debug.GPUname();
- }
-
- try
- {
- Debug.LogToFile("INFO Trying to get GPU update URL.");
- gpuURL = Util.GetGpuUrl();
- }
- catch (ArgumentException)
- {
- Debug.LogToFile("WARN Could not get GPU update URL, trying again with non-studio driver.");
- try
- {
- // disable SD and try with GRD
- if (File.Exists(GlobalVars.exedirectory + "sd.envy"))
- {
- File.Delete(GlobalVars.exedirectory + "sd.envy");
- }
-
- gpuURL = Util.GetGpuUrl(); //try again with GRD
- MessageBox.Show(Properties.Resources.ui_studionotsupported);
- radioGRD.IsChecked = true;
- }
- catch (ArgumentNullException)
- {
- MessageBox.Show("ERROR: Could not get list of GPU models from Nvidia, please check your network connection.\nOtherwise, please report this issue on GitHub.");
- Environment.Exit(11);
- }
- catch (ArgumentException e)
- {
- // Now we have a problem.
- Debug.LogToFile("FATAL Invalid API response from Nvidia. Attempted API call: " + e.Message);
- MessageBox.Show("ERROR: Invalid API response from Nvidia. Please file an issue on GitHub.\nAttempted API call:\n" + e.Message);
- Environment.Exit(10);
- }
- }
-
- using (var c = new WebClient())
- {
- Debug.LogToFile("INFO Trying to get newest driver version.");
- string pContent = c.DownloadString(gpuURL);
- var pattern = @"Windows\/\d{3}\.\d{2}";
- Regex rgx = new Regex(pattern);
- var matches = rgx.Matches(pContent);
- onlineDriv = Regex.Replace(Convert.ToString(matches[0]), "Windows/", "");
- textblockOnline.Text = onlineDriv;
- Debug.LogToFile("INFO Got online driver version: " + onlineDriv);
- }
-
- try
- {
- if (float.Parse(localDriv) < float.Parse(onlineDriv))
- {
- Debug.LogToFile("INFO Local version is older than online. Setting UI...");
- textblockOnline.Foreground = Brushes.Red;
- buttonDL.IsEnabled = true;
- if (skippedVer == null)
- {
- buttonSkip.Content = Properties.Resources.ui_skipversion;
- buttonSkip.IsEnabled = true;
- }
- else
- buttonSkip.Content = Properties.Resources.ui_skipped;
-
- Debug.LogToFile("INFO UI set.");
-
- if (skippedVer != onlineDriv)
- {
- Debug.LogToFile("INFO Showing update popup notification.");
- Notify.ShowDrivUpdatePopup();
- }
- }
- else
- {
- Debug.LogToFile("INFO Local version is up to date.");
- buttonSkip.IsEnabled = false;
- textblockOnline.Foreground = Brushes.Green;
- }
- }
- catch (FormatException)
- {
- Debug.LogToFile("INFO Caught FormatException, assuming locale workaround is necessary.");
- //Thank you locales. Some languages need , instead of . for proper parsing
- string cLocalDriv = localDriv.Replace('.', ',');
- string cOnlineDriv = onlineDriv.Replace('.', ',');
- if (float.Parse(cLocalDriv) < float.Parse(cOnlineDriv))
- {
- Debug.LogToFile("INFO Local version is older than online. Setting UI...");
- textblockOnline.Foreground = Brushes.Red;
- buttonDL.IsEnabled = true;
- if (skippedVer == null)
- buttonSkip.IsEnabled = true;
- else
- buttonSkip.Content = Properties.Resources.ui_skipped;
- if (skippedVer != onlineDriv)
- {
- Debug.LogToFile("INFO Showing update popup notification.");
- Notify.ShowDrivUpdatePopup();
- }
- }
- else
- {
- Debug.LogToFile("INFO Local version is up to date.");
- buttonSkip.IsEnabled = false;
- textblockOnline.Foreground = Brushes.Green;
- }
- }
-
- //Check for different version than skipped version
- if (skippedVer != null && skippedVer != onlineDriv)
- {
- Debug.LogToFile("INFO Skipped version is surpassed, deleting setting.");
- skippedVer = null;
- if (File.Exists(GlobalVars.exedirectory + "skip.envy"))
- File.Delete(GlobalVars.exedirectory + "skip.envy");
- buttonSkip.Content = Properties.Resources.ui_skipversion;
- buttonSkip.IsEnabled = true;
- }
- }
-
- private void buttonDL_Click(object sender, RoutedEventArgs e)
- {
- Debug.LogToFile("INFO Opening download page.");
- Process.Start(gpuURL);
- }
-
- private void TaskbarIcon_TrayLeftMouseDown(object sender, RoutedEventArgs e)
- {
- Debug.LogToFile("INFO Tray was clicked, opening main window.");
- Util.ShowMain();
- }
-
private void Window_StateChanged(object sender, EventArgs e)
{
if (WindowState == WindowState.Minimized)
@@ -324,115 +79,25 @@ namespace EnvyUpdate
}
}
- public void UninstallAll()
- {
- if (File.Exists(GlobalVars.startup + "\\EnvyUpdate.lnk"))
- {
- Debug.LogToFile("INFO Deleted startup entry.");
- File.Delete(GlobalVars.startup + "\\EnvyUpdate.lnk");
- }
-
- if (File.Exists(GlobalVars.startmenu + "\\EnvyUpdate.lnk"))
- {
- Debug.LogToFile("INFO Deleted start menu entry.");
- File.Delete(GlobalVars.startmenu + "\\EnvyUpdate.lnk");
- }
- if ((GlobalVars.exedirectory == GlobalVars.appdata) && File.Exists(GlobalVars.appdata + "EnvyUpdate.exe"))
- {
- Debug.LogToFile("INFO Deleting EnvyUpdate appdata and self.");
- MessageBox.Show(Properties.Resources.uninstall_legacy_message);
- Util.SelfDelete();
- }
- else if (Directory.Exists(GlobalVars.appdata))
- {
- Debug.LogToFile("INFO Deleting EnvyUpdate appdata folder");
- Directory.Delete(GlobalVars.appdata, true);
- }
- }
-
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
- if (MessageBox.Show(Properties.Resources.exit_confirm, "", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
- {
- Debug.LogToFile("INFO Uninstalling notifications and shutting down.");
- ToastNotificationManagerCompat.Uninstall(); // Uninstall notifications to prevent issues with the app being portable.
- Application.Current.Shutdown();
- }
- else
- {
- Debug.LogToFile("INFO Application shutdown was cancelled.");
- e.Cancel = true;
- }
+ Debug.LogToFile("INFO Uninstalling notifications and shutting down.");
+ ToastNotificationManagerCompat.Uninstall(); // Uninstall notifications to prevent issues with the app being portable.
+ Application.Current.Shutdown();
}
- private void radioGRD_Checked(object sender, RoutedEventArgs e)
+ private void UiWindow_Activated(object sender, EventArgs e)
{
- if (File.Exists(GlobalVars.exedirectory + "sd.envy"))
+ // This is a workaround for a bug (?) in the UI library, which causes the nav to not load the first item on startup.
+ // Without this, the nav attempts to navigate before the window is shown, which doesn't work.
+ try
{
- Debug.LogToFile("INFO Switching to game ready driver.");
- File.Delete(GlobalVars.exedirectory + "sd.envy");
- Load();
+ var test = RootNavigation.Current.PageType;
}
- }
-
- private void radioSD_Checked(object sender, RoutedEventArgs e)
- {
- if (!File.Exists(GlobalVars.exedirectory + "sd.envy"))
+ catch (NullReferenceException)
{
- Debug.LogToFile("INFO Switching to studio driver.");
- File.Create(GlobalVars.exedirectory + "sd.envy").Close();
- Load();
+ RootNavigation.Navigate(0);
}
}
-
- private void chkAutostart_Click(object sender, RoutedEventArgs e)
- {
- if (File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "EnvyUpdate.lnk")))
- {
- Debug.LogToFile("INFO Removing autostart entry.");
- File.Delete(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "EnvyUpdate.lnk"));
- }
- if (chkAutostart.IsChecked == true)
- {
- Debug.LogToFile("INFO Creating autostart entry.");
- Util.CreateShortcut("EnvyUpdate", Environment.GetFolderPath(Environment.SpecialFolder.Startup), GlobalVars.exeloc, "NVidia Update Checker", "/minimize");
- }
- }
-
- private void buttonSkip_Click(object sender, RoutedEventArgs e)
- {
- Debug.LogToFile("INFO Skipping version.");
- skippedVer = onlineDriv;
- File.WriteAllText(GlobalVars.exedirectory + "skip.envy", onlineDriv);
- buttonSkip.IsEnabled = false;
- buttonSkip.Content = Properties.Resources.ui_skipped;
- MessageBox.Show(Properties.Resources.skip_confirm);
- }
-
- private void UpdateLocalVer(bool reloadLocalDriv = true)
- {
- Debug.LogToFile("INFO Updating local driver version in UI.");
- if (reloadLocalDriv)
- {
- Debug.LogToFile("INFO Reloading local driver version.");
- localDriv = Util.GetLocDriv();
- }
- textblockGPU.Text = localDriv;
- if (GlobalVars.isMobile)
- textblockGPUName.Text = Util.GetGPUName(false) + " (mobile)";
- else
- textblockGPUName.Text = Util.GetGPUName(false);
- }
-
- void DriverFileChanged(object sender, FileSystemEventArgs e)
- {
- Debug.LogToFile("INFO Watched driver file changed! Reloading data.");
- System.Threading.Thread.Sleep(10000);
- Application.Current.Dispatcher.Invoke(delegate
- {
- UpdateLocalVer();
- Load();
- });
- }
}
}
\ No newline at end of file
diff --git a/EnvyUpdate/Properties/Licenses.Designer.cs b/EnvyUpdate/Properties/Licenses.Designer.cs
new file mode 100644
index 0000000..5c0056d
--- /dev/null
+++ b/EnvyUpdate/Properties/Licenses.Designer.cs
@@ -0,0 +1,153 @@
+//------------------------------------------------------------------------------
+//
+// 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 {
+ using System;
+
+
+ ///
+ /// 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", "17.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Licenses {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Licenses() {
+ }
+
+ ///
+ /// 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 (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("EnvyUpdate.Properties.Licenses", typeof(Licenses).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;
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The MIT License
+ ///
+ ///Copyright (c) 2012 Simon Cropp and contributors
+ ///
+ ///Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ ///
+ ///The ab [rest of string was truncated]";.
+ ///
+ internal static string CosturaFody {
+ get {
+ return ResourceManager.GetString("CosturaFody", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to MIT License
+ ///
+ ///Copyright (c) 2019-2023 Jakob Senkl
+ ///
+ ///Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ ///
+ ///The above copyright no [rest of string was truncated]";.
+ ///
+ internal static string EnvyUpdate {
+ get {
+ return ResourceManager.GetString("EnvyUpdate", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to MIT License
+ ///
+ ///Copyright (c) Simon Cropp
+ ///
+ ///Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ ///
+ ///The above copyright notice and t [rest of string was truncated]";.
+ ///
+ internal static string Fody {
+ get {
+ return ResourceManager.GetString("Fody", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The MIT License (MIT)
+ ///
+ ///Copyright (c) MarcStan
+ ///
+ ///Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ ///
+ ///The above copyright notic [rest of string was truncated]";.
+ ///
+ internal static string ResourceEmbedder {
+ get {
+ return ResourceManager.GetString("ResourceEmbedder", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to # Windows Community Toolkit
+ ///
+ ///Copyright © .NET Foundation and Contributors
+ ///
+ ///All rights reserved.
+ ///
+ ///## MIT License (MIT)
+ ///
+ ///Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished [rest of string was truncated]";.
+ ///
+ internal static string WindowsCommunityToolkit {
+ get {
+ return ResourceManager.GetString("WindowsCommunityToolkit", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to MIT License
+ ///
+ ///Copyright (c) 2021-2023 Leszek Pomianowski and WPF UI Contributors. https://dev.lepo.co/
+ ///
+ ///Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject t [rest of string was truncated]";.
+ ///
+ internal static string wpfui {
+ get {
+ return ResourceManager.GetString("wpfui", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/EnvyUpdate/Properties/Licenses.resx b/EnvyUpdate/Properties/Licenses.resx
new file mode 100644
index 0000000..6ebf13d
--- /dev/null
+++ b/EnvyUpdate/Properties/Licenses.resx
@@ -0,0 +1,190 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ The MIT License
+
+Copyright (c) 2012 Simon Cropp and contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+ MIT License
+
+Copyright (c) 2019-2023 Jakob Senkl
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+ MIT License
+
+Copyright (c) Simon Cropp
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+ The MIT License (MIT)
+
+Copyright (c) MarcStan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+ # Windows Community Toolkit
+
+Copyright © .NET Foundation and Contributors
+
+All rights reserved.
+
+## MIT License (MIT)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+ MIT License
+
+Copyright (c) 2021-2023 Leszek Pomianowski and WPF UI Contributors. https://dev.lepo.co/
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
\ No newline at end of file
diff --git a/EnvyUpdate/Properties/Resources.Designer.cs b/EnvyUpdate/Properties/Resources.Designer.cs
index cd696e7..c17e88a 100644
--- a/EnvyUpdate/Properties/Resources.Designer.cs
+++ b/EnvyUpdate/Properties/Resources.Designer.cs
@@ -114,6 +114,15 @@ namespace EnvyUpdate.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to No.
+ ///
+ public static string no {
+ get {
+ return ResourceManager.GetString("no", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to No NVIDIA GPU found. Application will exit..
///
@@ -141,6 +150,24 @@ namespace EnvyUpdate.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Enable logging to file.
+ ///
+ public static string ui_enable_logging {
+ get {
+ return ResourceManager.GetString("ui_enable_logging", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Home.
+ ///
+ public static string ui_home {
+ get {
+ return ResourceManager.GetString("ui_home", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to DCH driver.
///
@@ -159,6 +186,24 @@ namespace EnvyUpdate.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Update available..
+ ///
+ public static string ui_info_outdated {
+ get {
+ return ResourceManager.GetString("ui_info_outdated", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Up to date..
+ ///
+ public static string ui_info_uptodate {
+ get {
+ return ResourceManager.GetString("ui_info_uptodate", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to EnvyUpdate website.
///
@@ -177,6 +222,15 @@ namespace EnvyUpdate.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Licenses.
+ ///
+ public static string ui_licenses {
+ get {
+ return ResourceManager.GetString("ui_licenses", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Local driver version:.
///
@@ -195,6 +249,24 @@ namespace EnvyUpdate.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to All good..
+ ///
+ public static string ui_message_good {
+ get {
+ return ResourceManager.GetString("ui_message_good", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to New driver found..
+ ///
+ public static string ui_message_update {
+ get {
+ return ResourceManager.GetString("ui_message_update", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Online driver version:.
///
@@ -204,6 +276,24 @@ namespace EnvyUpdate.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Open website.
+ ///
+ public static string ui_openwebsite {
+ get {
+ return ResourceManager.GetString("ui_openwebsite", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Settings.
+ ///
+ public static string ui_settings {
+ get {
+ return ResourceManager.GetString("ui_settings", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Version skipped.
///
@@ -266,5 +356,14 @@ namespace EnvyUpdate.Properties {
return ResourceManager.GetString("update_popup_message", resourceCulture);
}
}
+
+ ///
+ /// Looks up a localized string similar to Yes.
+ ///
+ public static string yes {
+ get {
+ return ResourceManager.GetString("yes", resourceCulture);
+ }
+ }
}
}
diff --git a/EnvyUpdate/Properties/Resources.de.resx b/EnvyUpdate/Properties/Resources.de.resx
index 1329401..eace543 100644
--- a/EnvyUpdate/Properties/Resources.de.resx
+++ b/EnvyUpdate/Properties/Resources.de.resx
@@ -135,6 +135,9 @@
Neue Version von EnvyUpdate gefunden. Die Anwendung wird neu starten.\nDies wird wahrscheinlich einige Sekunden dauern.
+
+ Nein
+
Keine NVIDIA GPU gefunden. EnvyUpdate wird sich nun schließen.
@@ -144,27 +147,54 @@
Beim Start von Windows ausführen
+
+ Programm-Log in Datei schreiben
+
+
+ Start
+
DCH Treiber
Mobile Grafikkarte (Laptop, etc)?
+
+ Aktualisierung verfügbar.
+
+
+ Aktuell.
+
EnvyUpdate Webseite
Installieren
+
+ Lizenzen
+
Lokale Treiberversion:
Lokaler Treibertyp:
+
+ Alles in Ordnung.
+
+
+ Neue Treiberversion gefunden.
+
Online Treiberversion:
+
+ Webseite öffnen
+
+
+ Einstellungen
+
Version übersprungen
@@ -186,4 +216,7 @@
Eine neue Treiberversion ist verfügbar.
+
+ Ja
+
\ No newline at end of file
diff --git a/EnvyUpdate/Properties/Resources.resx b/EnvyUpdate/Properties/Resources.resx
index abdfedd..bb5275a 100644
--- a/EnvyUpdate/Properties/Resources.resx
+++ b/EnvyUpdate/Properties/Resources.resx
@@ -135,6 +135,9 @@
New version of EnvyUpdate found. Application will restart.\nThis will probably take a few seconds.
+
+ No
+
No NVIDIA GPU found. Application will exit.
@@ -144,27 +147,54 @@
Run at Windows startup
+
+ Enable logging to file
+
+
+ Home
+
DCH driver
Mobile GPU (Laptop, etc)?
+
+ Update available.
+
+
+ Up to date.
+
EnvyUpdate website
Install
+
+ Licenses
+
Local driver version:
Local driver type:
+
+ All good.
+
+
+ New driver found.
+
Online driver version:
+
+ Open website
+
+
+ Settings
+
Version skipped
@@ -186,4 +216,7 @@
A new driver update is available for your graphics card.
+
+ Yes
+
\ No newline at end of file
diff --git a/EnvyUpdate/SettingsPage.xaml b/EnvyUpdate/SettingsPage.xaml
new file mode 100644
index 0000000..5525ad8
--- /dev/null
+++ b/EnvyUpdate/SettingsPage.xaml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EnvyUpdate/InfoWindow.xaml.cs b/EnvyUpdate/SettingsPage.xaml.cs
similarity index 58%
rename from EnvyUpdate/InfoWindow.xaml.cs
rename to EnvyUpdate/SettingsPage.xaml.cs
index 6f369cb..b6373e5 100644
--- a/EnvyUpdate/InfoWindow.xaml.cs
+++ b/EnvyUpdate/SettingsPage.xaml.cs
@@ -1,32 +1,38 @@
using System;
-using System.Windows;
-using System.Windows.Input;
+using System.Collections.Generic;
using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
namespace EnvyUpdate
{
///
- /// Interaction logic for InfoWindow.xaml
+ /// Interaction logic for SettingsPage.xaml
///
- public partial class InfoWindow : Window
+ public partial class SettingsPage
{
- public InfoWindow()
+ public SettingsPage()
{
InitializeComponent();
- System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
- System.Diagnostics.FileVersionInfo fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location);
- string version = fvi.FileVersion;
-
- labelVer.Content += " " + version;
- if (GlobalVars.monitoringInstall)
- labelVer.FontStyle = FontStyles.Italic;
-
- if (File.Exists(Path.Combine(GlobalVars.exedirectory, "envyupdate.log")))
- chkLog.IsChecked = true;
+ textBoxLicEnvyupdate.Text = Properties.Licenses.EnvyUpdate;
+ textBoxLicFody.Text = Properties.Licenses.Fody;
+ textBoxLicCostura.Text = Properties.Licenses.CosturaFody;
+ textBoxLicResourceembedder.Text = Properties.Licenses.ResourceEmbedder;
+ textBoxLicWindowscommunitytoolkit.Text = Properties.Licenses.WindowsCommunityToolkit;
+ textBoxLicWpfui.Text = Properties.Licenses.wpfui;
}
- private void ButtonWeb_Click(object sender, RoutedEventArgs e)
+ private void CardWeb_Click(object sender, RoutedEventArgs e)
{
Debug.LogToFile("INFO Launching website.");
System.Diagnostics.Process.Start("https://github.com/fyr77/EnvyUpdate/");
diff --git a/README.md b/README.md
index 15c718d..d1a58b5 100644
--- a/README.md
+++ b/README.md
@@ -49,7 +49,7 @@ EnvyUpdate is not a replacement for any of these tools. I will still try to impl
* This project: [MIT](https://github.com/fyr77/EnvyUpdate/blob/master/LICENSE)
* Fody (dependency of Costura.Fody): [MIT](https://github.com/Fody/Fody/blob/master/License.txt)
* Costura.Fody (for embedding DLLs into the main executable): [MIT](https://github.com/Fody/Costura/blob/develop/LICENSE)
-* wpf-notifyicon (for showing an icon in the system tray): [CPOL](https://github.com/hardcodet/wpf-notifyicon/blob/master/LICENSE)
-* Resource Embedder: [MIT](https://github.com/MarcStan/resource-embedder/blob/master/LICENSE)
+* Resource Embedder: [MIT](https://www.nuget.org/packages/Resource.Embedder/)
* Windows Community Toolkit: [MIT](https://github.com/CommunityToolkit/WindowsCommunityToolkit/blob/main/License.md)
+* wpfui: [MIT](https://github.com/lepoco/wpfui/blob/main/LICENSE)
* Icon made by Freepik from www.flaticon.com