如何使用Inno Setup清除用户的应用程序数据文件夹? [英] How to clear user's app data folders with Inno Setup?

查看:616
本文介绍了如何使用Inno Setup清除用户的应用程序数据文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用Inno Setup卸载程序卸载应用程序时,将保留在用户的AppData文件夹中创建的运行时文件。可以删除它们吗?

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?

推荐答案

您可以创建一个CurUninstallStepChanged例程来执行所需的任何自定义操作,例如删除文件上的

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;

这篇关于如何使用Inno Setup清除用户的应用程序数据文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆