WIX property from a Custom Action into a WIX variable

感情迁移 提交于 2019-12-10 11:18:38

问题


May seem like a trivial question but I cant get it to work.

QUESTION: Can u set a WIX property from a Custom Action into a WIX variable?

This is what I have tried:

<?define VAR = "ProductName"?>

<Product Id="*" Name="$(var.VAR)" Language="1033" Version="1.0.0.0" UpgradeCode="$(var.UpgradeCode)">

<Property Id="VAR">ProductName</Property>

<CustomAction Id='GetProductName' BinaryKey='GetProductName' DllEntry='GetProductName' Execute='immediate' Return='check' />
<CustomAction Id="CustomAction1" Return="check" Execute="immediate" Property="VAR" Value="[PRODUCTNAME]" />


<InstallUISequence>
  <Custom Action='GetProductName' After='AppSearch' />
  <Custom Action='CustomAction1' After='GetProductName' />
</InstallUISequence>

PRODUCTNAME is the property i have set from my custom action.

Thanks


回答1:


WiX variables are a build / compile concept, not a installtime concept. It isn't possible.

What are you really trying to do? If you are trying to change the ProductName property during the installation, be aware that you can't. That property is immutable once the installation starts.



来源:https://stackoverflow.com/questions/12052457/wix-property-from-a-custom-action-into-a-wix-variable

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