0
votes

I am creating the installer for my Windows application via Inno Setup. The application itself writes some configuration data to the user home folder, into its own sub-directory.

Now during uninstallation I want to allow the user to select an option to delete that folder as well (which originally has not been created by Inno Setup, but by the application).

What would be the best way to achieve that in Inno Setup?

1

1 Answers

1
votes

There's no explicit support for this in Inno Setup. But you can code it in pascal script using CurUninstallStepChanged event function:

[Code]

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep = usUninstall then
  begin
    if MsgBox('Do you want to delete?', mbConfirmation, MB_YESNO) = idYes then
    begin
      DelTree(ExpandConstant('{app}\Folder'), True, True, True);
    end;
  end;
end;