From 48bb49671a7935fd0052686d95ebbe9332dd8ec7 Mon Sep 17 00:00:00 2001 From: fyr77 Date: Mon, 26 Feb 2024 19:23:07 +0100 Subject: [PATCH] handle unfinished downloads --- EnvyUpdate/MainWindow.xaml.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/EnvyUpdate/MainWindow.xaml.cs b/EnvyUpdate/MainWindow.xaml.cs index 51fc08c..d139842 100644 --- a/EnvyUpdate/MainWindow.xaml.cs +++ b/EnvyUpdate/MainWindow.xaml.cs @@ -102,6 +102,17 @@ 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); }