我正在使用wix RadioButton接受值,“是”或“否”。根据用户选择我正在设置属性。基于属性我正在设置一个注册表项。
<Control Id="Enable" Type="RadioButtonGroup" X="20" Y="100" Width="330" Height="40" Property="ENABLEKEY1" Hidden="yes">
<RadioButtonGroup Property="ENABLEKEY1">
<RadioButton Value="1" X="10" Y="0" Width="250" Height="20" Text="!(loc.WixUIYes)" />
<RadioButton Value="0" X="10" Y="20" Width="250" Height="20" Text="!(loc.WixUINo)" />
</RadioButtonGroup>
<Condition Action="show">ALLOWENABLEKEY1=1</Condition>
<Condition Action="enable">ALLOWENABLEKEY1=1</Condition>
</Control>
以下是设置注册表的代码:
<Component Id="C1" Guid="{A2186658-6214-4D31-21A6-F9AA48889A4A}">
<RegistryKey Id="R1" Root="HKLM" Key="SOFTWARE\MYPRODUCT" Action="createAndRemoveOnUninstall">
<RegistryValue Type="integer" Name="EnableKey1" Value="[ALLOWENABLEKEY1]" Action="write"/>
</RegistryKey>
</Component>
当我选择单选按钮“否”时,注册表会正确填充到0.但在维护模式下(更改/修改)如果我选择“是”选项,则注册表仍具有0值。它没有更新为1。
有谁能告诉我我做错了什么?
非常感谢
马克
答案 0 :(得分:3)
确保重新安装模式包含“um”标志。 http://msdn.microsoft.com/en-us/library/windows/desktop/aa371182(v=vs.85).aspx
日志也非常有用
答案 1 :(得分:0)
修改UI以设置Reinstall和ReinstallMode属性,如this answer
中所述