Adding option to delete settings on uninstall (#765)

This commit is contained in:
Raivis Dejus 2024-05-30 09:20:13 +03:00 committed by GitHub
parent 618b75a62b
commit bc1465ffd1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;