mirror of
https://github.com/chidiwilliams/buzz.git
synced 2026-03-14 14:45:46 +01:00
Adding option to delete saved models and files on uninstall (#1291)
This commit is contained in:
parent
f3765a586f
commit
252db3c3ed
1 changed files with 15 additions and 10 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue