From 21e7c2c2513bab9770e60fbd137d1bed800506b3 Mon Sep 17 00:00:00 2001 From: Raivis Dejus Date: Sun, 24 Nov 2024 11:30:44 +0200 Subject: [PATCH] Will delete old Buzz files when installing new version (#1007) --- installer.iss | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/installer.iss b/installer.iss index ff53e09a8..2e45008d3 100644 --- a/installer.iss +++ b/installer.iss @@ -57,4 +57,24 @@ begin then RegDeleteKeyIncludingSubkeys(HKEY_CURRENT_USER, '{#AppRegKey}'); end; +end; +procedure DeleteFileOrFolder(FilePath: string); +begin + if FileExists(FilePath) then + begin + DeleteFile(FilePath); + end + else if DirExists(FilePath) then + begin + DelTree(FilePath, True, True, True); + end; +end; + +procedure CurStepChanged(CurStep: TSetupStep); +begin + if CurStep = ssInstall then + begin + DeleteFileOrFolder(ExpandConstant('{app}\Buzz.exe')); + DeleteFileOrFolder(ExpandConstant('{app}\_internal')); + end; end; \ No newline at end of file