问题描述
我在Burn中具有自定义UI,其中带有安装桌面图标复选框。而且我的MSI(也是用WiX创建)具有与替换Burn相同的功能。问题在于,Burn似乎将复选框值设置为 0
或 1
(通过 MsiProperty
),而我的MSI期望 NULL
或 NOT NULL
。如果尝试通过Burn发送复选框值,则MSI始终会将其评估为NOT NULL。我发现可以编辑我的WiX项目并进行更改:
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>
至:
<Condition>DESKTOP_ICONS = 1</Condition>
这将解决问题。但是,是否有任何方法可以使Burn根据复选框的值将NULL或NOT NULL传递给MSI?
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?
推荐答案
Burn将 true和 checked视为 1,将 0视为false。但是,您可以在MSI中创建一个自定义操作,该操作会将数字属性转换为 NULL。看起来像这样:
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>
现在属性
名为 NULL(如果 DESKTOP_ICONS
属性设置为 1,则将定义一个非常有趣的名称,恕我直言。
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".
这篇关于WiX-将复选框值从Burn UI传递到MSI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!