问题
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