From 90ba89f840d2e1ff4b1463a56aa6ad6d26a8b683 Mon Sep 17 00:00:00 2001 From: N00MKRAD <61149547+n00mkrad@users.noreply.github.com> Date: Wed, 16 Oct 2024 11:40:31 +0200 Subject: [PATCH] Cleanup function: Delete installer temp folder if not modified in >1d --- CodeLegacy/Program.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CodeLegacy/Program.cs b/CodeLegacy/Program.cs index 8d71cc9..87d3502 100644 --- a/CodeLegacy/Program.cs +++ b/CodeLegacy/Program.cs @@ -132,6 +132,12 @@ namespace Flowframes string crashDumpsDir = Path.Combine(Environment.ExpandEnvironmentVariables("%LOCALAPPDATA%"), "CrashDumps"); IoUtils.GetFilesSorted(crashDumpsDir, false, "rife*.exe.*.dmp").ToList().ForEach(x => IoUtils.TryDeleteIfExists(x)); IoUtils.GetFilesSorted(crashDumpsDir, false, "flowframes*.exe.*.dmp").ToList().ForEach(x => IoUtils.TryDeleteIfExists(x)); + + string installerTempDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "FlowframesInstallerTemp"); + if (Directory.Exists(installerTempDir) && (DateTime.Now - Directory.GetLastWriteTime(installerTempDir)).TotalDays > 1d) + { + IoUtils.TryDeleteIfExists(installerTempDir); + } } catch (Exception e) {