开发者

How do I mark a directory to be deleted after reboot?

开发者 https://www.devze.com 2023-01-17 17:42 出处:网络
I\'ve g开发者_如何学Pythonot 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 d

I've g开发者_如何学Pythonot 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?


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消