diff --git a/EnvyUpdate/DashboardPage.xaml.cs b/EnvyUpdate/DashboardPage.xaml.cs index f53ef42..d275b3f 100644 --- a/EnvyUpdate/DashboardPage.xaml.cs +++ b/EnvyUpdate/DashboardPage.xaml.cs @@ -210,15 +210,6 @@ namespace EnvyUpdate if (skippedVer != onlineDriv) { - if (GlobalVars.autoDownload) - { - if (buttonDownload.IsVisible) - { - Debug.LogToFile("INFO Auto-Downloading driver."); - buttonDownload_Click(null, null); - } - } - Debug.LogToFile("INFO Showing update popup notification."); Notify.ShowDrivUpdatePopup(); } @@ -349,34 +340,25 @@ namespace EnvyUpdate private void buttonDownload_Click(object sender, RoutedEventArgs e) { - if (GlobalVars.isDownloading) - { - Debug.LogToFile("WARN A download is already running."); - ShowSnackbar(Wpf.Ui.Common.ControlAppearance.Danger, Wpf.Ui.Common.SymbolRegular.ErrorCircle24, Properties.Resources.info_download_running, Properties.Resources.info_download_running_title); - } - else - { - progressbarDownload.Visibility = Visibility.Visible; - buttonDownload.IsEnabled = false; - GlobalVars.isDownloading = true; + progressbarDownload.Visibility = Visibility.Visible; + buttonDownload.IsEnabled = false; - if (File.Exists(Path.Combine(GlobalVars.saveDirectory, onlineDriv + "-nvidia-installer.exe.downloading"))) - { - Debug.LogToFile("WARN Found previous unfinished download, retrying."); - File.Delete(Path.Combine(GlobalVars.saveDirectory, onlineDriv + "-nvidia-installer.exe.downloading")); - } - Thread thread = new Thread(() => { - using (WebClient client = new WebClient()) - { - client.Headers["User-Agent"] = GlobalVars.useragent; - client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged); - client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted); - client.DownloadFileAsync(new Uri(Util.GetDirectDownload(gpuURL)), Path.Combine(GlobalVars.saveDirectory, onlineDriv + "-nvidia-installer.exe.downloading")); - } - }); - thread.Start(); - Debug.LogToFile("INFO Started installer download."); + if (File.Exists(Path.Combine(GlobalVars.saveDirectory, onlineDriv + "-nvidia-installer.exe.downloading"))) + { + Debug.LogToFile("WARN Found previous unfinished download, retrying."); + File.Delete(Path.Combine(GlobalVars.saveDirectory, onlineDriv + "-nvidia-installer.exe.downloading")); } + Thread thread = new Thread(() => { + using (WebClient client = new WebClient()) + { + client.Headers["User-Agent"] = GlobalVars.useragent; + client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged); + client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted); + client.DownloadFileAsync(new Uri(Util.GetDirectDownload(gpuURL)), Path.Combine(GlobalVars.saveDirectory, onlineDriv + "-nvidia-installer.exe.downloading")); + } + }); + thread.Start(); + Debug.LogToFile("INFO Started installer download."); } void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) @@ -394,7 +376,6 @@ namespace EnvyUpdate Application.Current.Dispatcher.Invoke(new Action(() => { buttonDownload.IsEnabled = true; progressbarDownload.Visibility = Visibility.Collapsed; - GlobalVars.isDownloading = false; })); if (e.Error == null) { diff --git a/EnvyUpdate/EnvyUpdate.csproj b/EnvyUpdate/EnvyUpdate.csproj index cc7331b..4dd0c93 100644 --- a/EnvyUpdate/EnvyUpdate.csproj +++ b/EnvyUpdate/EnvyUpdate.csproj @@ -271,7 +271,7 @@ 5.7.0 - 6.8.1 + 6.8.0 runtime; build; native; contentfiles; analyzers; buildtransitive all @@ -282,7 +282,7 @@ 2.2.0 - 8.0.4 + 7.0.3 2.1.0 diff --git a/EnvyUpdate/GlobalVars.cs b/EnvyUpdate/GlobalVars.cs index f52b4af..e830039 100644 --- a/EnvyUpdate/GlobalVars.cs +++ b/EnvyUpdate/GlobalVars.cs @@ -19,7 +19,5 @@ 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; - public static bool isDownloading = false; } } diff --git a/EnvyUpdate/MainWindow.xaml.cs b/EnvyUpdate/MainWindow.xaml.cs index 6522ee3..51fc08c 100644 --- a/EnvyUpdate/MainWindow.xaml.cs +++ b/EnvyUpdate/MainWindow.xaml.cs @@ -102,25 +102,8 @@ namespace EnvyUpdate GlobalVars.startMinimized = true; } - //Check for old unfinished downloads - string[] leftovers = Directory.GetFiles(GlobalVars.directoryOfExe, "*-nvidia-installer.exe.downloading"); - if (leftovers.Length > 0) - { - foreach (string leftover in leftovers) - { - Debug.LogToFile("INFO Deleting leftover download " + leftover); - File.Delete(leftover); - } - } - GlobalVars.isMobile = Util.IsMobile(); Debug.LogToFile("INFO Mobile: " + GlobalVars.isMobile); - - if (File.Exists(Path.Combine(GlobalVars.saveDirectory, "autodl.envy"))) - { - Debug.LogToFile("INFO Auto-download is enabled."); - GlobalVars.autoDownload = true; - } } private void Window_StateChanged(object sender, EventArgs e) { diff --git a/EnvyUpdate/Notify.cs b/EnvyUpdate/Notify.cs index d889163..ac317c1 100644 --- a/EnvyUpdate/Notify.cs +++ b/EnvyUpdate/Notify.cs @@ -6,16 +6,9 @@ namespace EnvyUpdate { public static void ShowDrivUpdatePopup() { - try - { - var toast = new ToastContentBuilder(); - toast.AddText(Properties.Resources.update_popup_message); - toast.Show(); - } - catch (System.Exception ex) - { - Debug.LogToFile("WARN Could not show notification. Error: " + ex.Message); - } + var toast = new ToastContentBuilder(); + toast.AddText(Properties.Resources.update_popup_message); + toast.Show(); } } } \ No newline at end of file diff --git a/EnvyUpdate/Properties/AssemblyInfo.cs b/EnvyUpdate/Properties/AssemblyInfo.cs index b9441b1..6eeb6d9 100644 --- a/EnvyUpdate/Properties/AssemblyInfo.cs +++ b/EnvyUpdate/Properties/AssemblyInfo.cs @@ -49,5 +49,5 @@ using System.Windows; // 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("3.6")] -[assembly: AssemblyFileVersion("3.6")] +[assembly: AssemblyVersion("3.4")] +[assembly: AssemblyFileVersion("3.4")] diff --git a/EnvyUpdate/Properties/Resources.Designer.cs b/EnvyUpdate/Properties/Resources.Designer.cs index 466a9c0..4f80cf9 100644 --- a/EnvyUpdate/Properties/Resources.Designer.cs +++ b/EnvyUpdate/Properties/Resources.Designer.cs @@ -105,24 +105,6 @@ namespace EnvyUpdate.Properties { } } - /// - /// Looks up a localized string similar to A download process is already running!. - /// - public static string info_download_running { - get { - return ResourceManager.GetString("info_download_running", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Download running. - /// - public static string info_download_running_title { - get { - return ResourceManager.GetString("info_download_running_title", resourceCulture); - } - } - /// /// Looks up a localized string similar to Driver installer successfully downloaded.. /// @@ -285,15 +267,6 @@ 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 b5a18f5..40102a4 100644 --- a/EnvyUpdate/Properties/Resources.de.resx +++ b/EnvyUpdate/Properties/Resources.de.resx @@ -132,12 +132,6 @@ Fehler beim Herunterladen - - Ein Downloadvorgang läuft bereits! - - - Download läuft - Treiber-Installationsdatei erfolgreich heruntergeladen. @@ -192,9 +186,6 @@ 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 2623dae..3780249 100644 --- a/EnvyUpdate/Properties/Resources.resx +++ b/EnvyUpdate/Properties/Resources.resx @@ -132,12 +132,6 @@ Error while downloading - - A download process is already running! - - - Download running - Driver installer successfully downloaded. @@ -192,9 +186,6 @@ Save files to AppData - - Download updates automatically - Enable logging to file diff --git a/EnvyUpdate/SettingsPage.xaml b/EnvyUpdate/SettingsPage.xaml index ab6f973..f00cd4b 100644 --- a/EnvyUpdate/SettingsPage.xaml +++ b/EnvyUpdate/SettingsPage.xaml @@ -35,19 +35,9 @@ - - - - - - - - - - - - - + + +