Wix Custom action set value from CA to wix

こ雲淡風輕ζ 提交于 2019-12-10 03:17:04

问题


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


回答1:


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.




回答2:


You can add an InstallFinalize immediate custom action, which is positioned after all deferred actions, and there you can reset the bundle's (XML) "RESTART" to whatever you want, because session will be available again.



来源:https://stackoverflow.com/questions/45548586/wix-custom-action-set-value-from-ca-to-wix

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!