Search code examples
c#wixwindows-installercustom-action

Wix Custom action set value from CA to wix


In deferred ( with impoersonate = no) to send the Value to the WIX to CA, i am using set property and value

and collecting the data in CA using session.CustomActionData["key"];

Is there any way to send back the data to the WIX from CA

<Property Id="RESTART" Secure="yes" Value="false" />

In immediate i was using,

session["RESTART"] = "true" 

... how to achieve this in deferred CA


Solution

  • You cannot modify the session from a deferred custom action; at that point, MSI is executing its script and there's no session to speak of. So you can't set a property. You need some other mechanism to communicate status. WiX's native library includes the functions WcaDeferredActionRequiresReboot to flag that a reboot is required and WcaDidDeferredActionRequireReboot for an immediate custom action scheduled after InstallFinalize to detect the reboot status.