From c55de4d27e616e4a79a4d08d3072573734858962 Mon Sep 17 00:00:00 2001 From: Raivis Dejus Date: Thu, 30 May 2024 07:55:02 +0300 Subject: [PATCH] Adding option to delete settings on uninstall --- installer.iss | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/installer.iss b/installer.iss index 666339125..ff53e09a8 100644 --- a/installer.iss +++ b/installer.iss @@ -6,6 +6,7 @@ #define AppIconPath "assets\buzz.ico" #define AppSourcePath "dist\Buzz\*" #define OutputDir "dist" +#define AppRegKey "Software\Buzz" [Setup] ; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. @@ -43,3 +44,17 @@ Name: "{autodesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Tasks: deskto [Run] Filename: "{app}\{#AppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(AppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent +[Registry] +Root: HKCU; Subkey: "{#AppRegKey}" + +[Code] +procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); +begin + if CurUninstallStep = usPostUninstall then + begin + if RegKeyExists(HKEY_CURRENT_USER, '{#AppRegKey}') then + if MsgBox('Do you want to delete Buzz settings?', mbConfirmation, MB_YESNO) = IDYES + then + RegDeleteKeyIncludingSubkeys(HKEY_CURRENT_USER, '{#AppRegKey}'); + end; +end; \ No newline at end of file