From b9e7aac55fbb8353ce30669fc682dfd5518ba2d0 Mon Sep 17 00:00:00 2001 From: fyr77 Date: Fri, 23 Feb 2024 20:30:40 +0100 Subject: [PATCH 01/14] add auto download feature --- EnvyUpdate/DashboardPage.xaml.cs | 6 ++++++ EnvyUpdate/GlobalVars.cs | 1 + EnvyUpdate/Properties/Resources.Designer.cs | 9 +++++++++ EnvyUpdate/Properties/Resources.de.resx | 3 +++ EnvyUpdate/Properties/Resources.resx | 3 +++ EnvyUpdate/SettingsPage.xaml | 16 +++++++++++++--- EnvyUpdate/SettingsPage.xaml.cs | 10 ++++++++++ 7 files changed, 45 insertions(+), 3 deletions(-) diff --git a/EnvyUpdate/DashboardPage.xaml.cs b/EnvyUpdate/DashboardPage.xaml.cs index d275b3f..d43e27a 100644 --- a/EnvyUpdate/DashboardPage.xaml.cs +++ b/EnvyUpdate/DashboardPage.xaml.cs @@ -210,6 +210,12 @@ namespace EnvyUpdate if (skippedVer != onlineDriv) { + if (GlobalVars.autoDownload) + { + Debug.LogToFile("INFO Auto-Downloading driver."); + buttonDownload_Click(null, null); + } + Debug.LogToFile("INFO Showing update popup notification."); Notify.ShowDrivUpdatePopup(); } diff --git a/EnvyUpdate/GlobalVars.cs b/EnvyUpdate/GlobalVars.cs index e830039..b56e851 100644 --- a/EnvyUpdate/GlobalVars.cs +++ b/EnvyUpdate/GlobalVars.cs @@ -19,5 +19,6 @@ namespace EnvyUpdate public static readonly string useragent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:115.0) Gecko/20100101 Firefox/115.0"; public static bool useAppdata = false; public static bool hasWrite = true; + public static bool autoDownload = false; } } diff --git a/EnvyUpdate/Properties/Resources.Designer.cs b/EnvyUpdate/Properties/Resources.Designer.cs index 4f80cf9..2442daa 100644 --- a/EnvyUpdate/Properties/Resources.Designer.cs +++ b/EnvyUpdate/Properties/Resources.Designer.cs @@ -267,6 +267,15 @@ namespace EnvyUpdate.Properties { } } + /// + /// Looks up a localized string similar to Download updates automatically. + /// + public static string ui_enable_autodownload { + get { + return ResourceManager.GetString("ui_enable_autodownload", resourceCulture); + } + } + /// /// Looks up a localized string similar to Enable logging to file. /// diff --git a/EnvyUpdate/Properties/Resources.de.resx b/EnvyUpdate/Properties/Resources.de.resx index 40102a4..296e7c4 100644 --- a/EnvyUpdate/Properties/Resources.de.resx +++ b/EnvyUpdate/Properties/Resources.de.resx @@ -186,6 +186,9 @@ Programmdaten in AppData speichern + + Updates automatisch herunterladen + Programm-Log in Datei schreiben diff --git a/EnvyUpdate/Properties/Resources.resx b/EnvyUpdate/Properties/Resources.resx index 3780249..304ee61 100644 --- a/EnvyUpdate/Properties/Resources.resx +++ b/EnvyUpdate/Properties/Resources.resx @@ -186,6 +186,9 @@ Save files to AppData + + Download updates automatically + Enable logging to file diff --git a/EnvyUpdate/SettingsPage.xaml b/EnvyUpdate/SettingsPage.xaml index f00cd4b..ab6f973 100644 --- a/EnvyUpdate/SettingsPage.xaml +++ b/EnvyUpdate/SettingsPage.xaml @@ -35,9 +35,19 @@ - - - + + + + + + + + + + + + +