How to clear user's app data folders with Inno Setup?

佐手、 提交于 2020-01-03 03:30:15

问题


When I uninstall my app with my Inno Setup uninstaller, the runtime files created in the user's AppData folder remain. Is it possible to remove them?


回答1:


you can create a CurUninstallStepChanged routine to perform any custom action you want, like deleting files on the system during uninstall.

Take a look at this example (from this question):

procedure CurUninstallStepChanged (CurUninstallStep: TUninstallStep);
var
  mres : integer;
begin
  case CurUninstallStep of
    usPostUninstall:
      begin
        mres := MsgBox('Do you want to delete saved files?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2)
        if mres = IDYES then
          DelTree(ExpandConstant('{userdocs}\MyApp'), True, True, True);
      end;  
  end;
end;


来源:https://stackoverflow.com/questions/4828674/how-to-clear-users-app-data-folders-with-inno-setup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!