简体   繁体   English

Inno Setup:卸载过程中重新启动后删除文件夹

[英]Inno Setup: Deleting folders after restart during uninstallation

I have a question about deleting folders during uninstallation using Inno Setup.我有一个关于在使用 Inno Setup 卸载期间删除文件夹的问题。

In my script, I use the uninsrestartdelete flag on some files and call DelTree on the {app} folder on the last step of uninstallation.在我的脚本中,我在某些文件上使用uninsrestartdelete标志,并在卸载的最后一步调用{app}文件夹上的DelTree Sometimes, I can't delete all files until system restart (those are code injection DLLs).有时,在系统重新启动之前我无法删除所有文件(那些是代码注入 DLL)。 In this situation, I can't delete the {app} folder successfully.在这种情况下,我无法成功删除{app}文件夹。 What's the correct way to delete the {app} folder on system restart as well?在系统重新启动时删除{app}文件夹的正确方法是什么? I can make sure there is no file left in the folder When I try to delete it.当我尝试删除它时,我可以确保文件夹中没有文件。

To schedule file or directory deletion on restart, call RestartReplace function with DestFile (second) argument set to an empty string ( '' ).要在重新启动时安排文件或目录删除,请调用RestartReplace function并将DestFile (第二个)参数设置为空字符串( '' )。

RestartReplace(FileToDelete, '');

For directories, this works, only if they are empty.对于目录,这只有在它们为空时才有效。 So you will have to first call RestartReplace for all files inside the directory, which cannot be deleted.因此,您必须首先为目录中的所有文件调用RestartReplace ,这些文件无法删除。

For details, refer to WinAPI function MoveFileEx and its MOVEFILE_DELAY_UNTIL_REBOOT flag, which is behind the Inno Setup RestartReplace function.详情参考WinAPI function MoveFileEx及其MOVEFILE_DELAY_UNTIL_REBOOT标志,它在 Inno Setup RestartReplace后面 ZC1C425268E68385D1AB50741C1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Inno Setup 中卸载期间从所有用户配置文件中删除日志文件 - Deleting log files from all user profiles during uninstallation in Inno Setup Inno Setup:重启过程中重启过程中无法启动 - Inno Setup: restart during setup process won't start after reboot 如何对Inno Setup生成的卸载文件进行数字签名? - How to digitally sign Inno Setup generated uninstallation file? 在 Inno Setup 中重新安装和卸载时停止 Windows 服务 - Stop a Windows service on re-installation and uninstallation in Inno Setup Inno Setup在静默安装期间将锁定文件替换为下次重新启动 - Inno Setup Postpone locked file replacing to the next restart during silent installation 静默重新安装期间Inno Setup程序包的行为 - Behavior of Inno Setup package during silent reinstall Inno Setup - 从需要特权的安装程序访问非特权帐户文件夹 - Inno Setup - Access unprivileged account folders from installer that requires privileges Inno Setup - 是否可以在卸载期间根据条件卸载文件? - Inno Setup - Is it possible to uninstall files based on a condition during uninstall? 如何根据命令行参数在 Inno Setup 中提示重新启动? - How can I prompt restart in Inno Setup based off command line argument? Inno Setup:在安装过程完成后执行命令/批处理文件 - Inno Setup : execute command/batch file after install process is complete
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM