[wix-users] Detecting whether a file will be removed on uninstall

Phil Wilson phil.wilson at mvps.org
Fri Sep 4 13:39:22 PDT 2015

I don't think it's possible to predict that reliably. If it's a simple
unregister I'd think about doing it in two parts. First, copy the file to
some temp folder early in the uninstall, then if it's really been removed,
later do the unregister on the temp copy and delete it. I don't think
unregister code cares where it runs from if it's just deleting registry


-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of
Griesshammer, Christoph (GE Healthcare)
Sent: Friday, September 04, 2015 1:15 PM
To: wix-users at lists.wixtoolset.org
Subject: [wix-users] Detecting whether a file will be removed on uninstall

Is there a way to detect whether a file will be removed on uninstall? I have
a custom action that I want to run, only if a file will be removed.

Essentially I want to do:
If I will remove file A then unregister file A first.

I know, I know. I shouldn't use a CA to (un)register files, but that's
beside the point right now.

Thank you for any help.

Christoph Griesshammer

WiX Toolset Users Mailing List provided by FireGiant

More information about the wix-users mailing list