如何在重新启动后标记要删除的目录? [英] How do I mark a directory to be deleted after reboot?

查看:34
本文介绍了如何在重新启动后标记要删除的目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个卸载程序,可以执行一些操作,然后提示用户重新启动.我希望在重新启动后删除一个目录.我知道有一种方法可以做到这一点,我只是不确定如何.

I've got an uninstaller that performs some actions and then prompts the user to reboot. I'd like a directory to be deleted after the reboot takes place. I know there's a way to do this, I'm just not sure how.

我正在使用 WiX 安装程序,我想我可以用它来做,不知何故,但我对替代品持开放态度(最简单的对我来说都很好).我的目标平台是 Windows 7,不过如果它也适用于旧版本的 Windows,那就太好了.

I'm using a WiX installer, and I'd imagine I could use that to do so, somehow, but I'm open to alternatives (whatever's simplest is just fine with me). My target platform is Windows 7, though it would be nice if this worked with older versions of Windows as well.

在重新启动后将此目录标记为删除的最简单方法是什么?

What's the simplest way to mark this directory for deletion after a reboot?

推荐答案

如果您有锁定文件的情况,Windows Installer 可以在重新启动后处理删除,但没有内置方法指示它仅在重启.我认为您可以做到的唯一方法是使用自定义操作来记录指示它执行删除操作的 RunOnce 注册表项.您不能为此使用注册表,因为 Windows Installer 无法在卸载过程中记录到注册表.

If you have a locked file condition Windows Installer can handle the deletion after the reboot but there is no built-in way of instructing it to only delete it after a reboot. I think the only way you could do it would be to use a custom action to record a RunOnce registry entry that instructs it to do the delete. You can't use the Registry table for this as Windows Installer has no way of recording to the registry as part of an uninstall.

不过,您在这条线上的线外着色,所以我想了解为什么要确定此要求是否有效.

Still, you are coloring outside the lines on this one so I'd want to understand the why of this requirement in determining if it's valid.

这篇关于如何在重新启动后标记要删除的目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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