如何标记重启后要删除的目录?

发布于 2024-09-24 16:54:14 字数 215 浏览 4 评论 0原文

我有一个卸载程序,它执行一些操作,然后提示用户重新启动。我希望在重新启动后删除一个目录。我知道有办法做到这一点,但我不确定如何做。

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

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

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.

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

暖树树初阳… 2024-10-01 16:54:14

如果您遇到锁定文件的情况,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.

甜是你 2024-10-01 16:54:14

尝试使用 SysInternal 的“MoveFile”。指定“”作为目标,然后噗!假设你最终没有陷入许可地狱......:(

Try using SysInternal's "MoveFile". Specify "" as the target and poof! Assuming you don't end up in permission hell... :(

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文