Inno Setup: Conditionally delete non-empty directory in user's home folder

前端 未结 1 369
情歌与酒
情歌与酒 2021-01-07 12:41

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-direct

1条回答
  •  情话喂你
    2021-01-07 13:28

    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;
    

    0 讨论(0)
提交回复
热议问题