Adding option to delete saved models and files on uninstall (#1291)

This commit is contained in:
Raivis Dejus 2025-11-24 21:59:21 +02:00 committed by GitHub
commit 252db3c3ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -51,16 +51,6 @@ Filename: "{app}\{#AppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(
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;
procedure DeleteFileOrFolder(FilePath: string);
begin
if FileExists(FilePath) then
@ -73,6 +63,21 @@ begin
end;
end;
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 and saved files?', mbConfirmation, MB_YESNO) = IDYES
then
begin
RegDeleteKeyIncludingSubkeys(HKEY_CURRENT_USER, '{#AppRegKey}');
// Remove model and cache directories
DeleteFileOrFolder(ExpandConstant('{localappdata}\Buzz'));
end;
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssInstall then