WiX - passing checkbox values from Burn UI to MSI

做~自己de王妃 提交于 2019-12-24 02:42:38

问题


I have custom UI in Burn with a checkbox "Install Desktop icon". And I have the same thing in my MSI (also created with WiX) that I'm replacing with Burn. The problem is that Burn seems to set checkbox values to 0 or 1 (via MsiProperty) whereas my MSI expects NULL or NOT NULL. If you try to send through the checkbox value from Burn it will always be evaluated as NOT NULL by the MSI. I have found that I can edit my WiX projects and change:

<Condition>DESKTOP_ICONS</Condition>

to:

<Condition>DESKTOP_ICONS = 1</Condition>

and this will solve the problem. But is there any way of getting Burn to pass NULL or NOT NULL to the MSI based on the value of a checkbox?


回答1:


Burn will treat "true" and "checked" as "1" and "0" for false. However, you could create a custom action in your MSI that would convert the numeric property into "NULL". It'd look something like:

<SetProperty Id="NULL" Value="1" After="AppSearch">DESKTOP_ICONS = 1</SetProperty>

Now the Property named "NULL" (which is a pretty funny name for a property, IMHO) will be defined if DESKTOP_ICONS property was set to "1".



来源:https://stackoverflow.com/questions/15296980/wix-passing-checkbox-values-from-burn-ui-to-msi

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