我正在通过Inno Setup为Windows应用程序创建安装程序.该应用程序本身将一些配置数据写入用户主文件夹,并进入其自己的子目录.
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.
现在在卸载过程中,我想允许用户选择一个选项来删除该文件夹(该文件夹最初不是由Inno Setup创建的,而是由应用程序创建的.)
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).
在Inno Setup中实现该目标的最佳方法是什么?
What would be the best way to achieve that in Inno Setup?
推荐答案在Inno Setup中没有对此的明确支持.但是您可以使用 CurUninstallStepChanged事件函数在帕斯卡脚本中对其进行编码:
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;更多推荐
Inno Setup:有条件地删除用户主文件夹中的非空目录
发布评论