Inno Setup Optional Remove appdata \ YourApp during uninstallation?

I am using Inno Setup and I want to remove AppData \ Local \ MyApp during a uninstall that the installer did not create, but I want to give users the option to delete this data without a message box.

Here is an example of the screen I'm trying to achieve.

enter image description here

Here are a few examples that I have already seen.

How to clear user application data folders using Inno Setup?

Cannot delete folder created in My Documents using Inno Setup

http://www.jrsoftware.org/ishelp/index.php?topic=uninstalldeletesection

http://www.codeproject.com/Questions/243529/Inno-Setup-ask-user-on-uninstall-if-they-want-to-k

How can my installer delete some files that it did not initially create?

I want to add an optional flag, so if the user uninstalls the program, they can delete this hidden data .. but if users only update or plan to install it later, they can leave this field unchecked and not delete this generated data.

I need to skip something really simple, but I just can't figure it out right now.

Thank.

+4
source share
1 answer

Here is an example of creating an msg window during uninstall -

`[Code]
 procedure CurUninstallStepChanged (CurUninstallStep: TUninstallStep);
 var
     mres : integer;
 begin
    case CurUninstallStep of                   
      usPostUninstall:
        begin
          mres := MsgBox('Do you want to Remove settings?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2)
          if mres = IDYES then
            DelTree(ExpandConstant('{userappdata}\Myapp'), True, True, True);
       end;
   end;
end;  `

You can change '{userappdata}\Myapp'as you prefer.

+2
source

All Articles