Search code examples
wixcustom-action

WiX: How to get if this is "Installed" state in c# custom action function?


I have a custom action c# function which need to know inside what is the state "Installed" or "NOT Installed". How to get this state?

I.e. I need to know this state (Installed OR NOT Installed) in c# custom action

<Custom Action="CA_myfun" After="PublishProduct">NOT Installed</Custom>
    </InstallExecuteSequence>

Solution

  • Assuming the custom action is scheduled for immediate execution:

    bool installed = session.EvalulateCondition("Installed");