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

Jeremy Drake jeremydrake+wix at eacceleration.com
Fri Sep 4 14:23:29 PDT 2015


Maybe I'm missing something, but why wouldn't you just condition the 
custom action on "$componentKey = 2"?  You'd need a rollback custom action 
to re-register on rollback, of course...

On Fri, 4 Sep 2015, Griesshammer, Christoph (GE Healthcare) wrote:

> Thank you for your answer. You inspired a combination of my workaround and your workaround:
>
> I'm always going to unregister the file.
> Then it will automatically leave/remove the file.
> Then I'll have a custom action detect if it's still there, and if it is, I'll re-register it.
>
> Thanks for your help,
> Christoph
>
> -----Original Message-----
> From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Phil Wilson
> Sent: Friday, September 04, 2015 4:39 PM
> To: 'WiX Toolset Users Mailing List'
> Subject: Re: [wix-users] Detecting whether a file will be removed on uninstall
>
> 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 entries.
>
> Phil
>
> -----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 https://urldefense.proofpoint.com/v2/url?u=http-3A__www.firegiant.com_&d=BQICAg&c=IV_clAzoPDE253xZdHuilRgztyh_RiV3wUrLrDQYWSI&r=-l6_npd-dx-ekbVSbypvaw-IcErQ11UE3f78jQgrCDw&m=_lq5K_eCJvYhCo95ydQe4zvjpe_Ws7a5AYaLyil8_10&s=mttIH2sD_ovq9Z5wd5bO7tlCHwKgUhytdHyX1uNcZFw&e=
>
>
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant https://urldefense.proofpoint.com/v2/url?u=http-3A__www.firegiant.com_&d=BQICAg&c=IV_clAzoPDE253xZdHuilRgztyh_RiV3wUrLrDQYWSI&r=-l6_npd-dx-ekbVSbypvaw-IcErQ11UE3f78jQgrCDw&m=_lq5K_eCJvYhCo95ydQe4zvjpe_Ws7a5AYaLyil8_10&s=mttIH2sD_ovq9Z5wd5bO7tlCHwKgUhytdHyX1uNcZFw&e=
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
>



More information about the wix-users mailing list