Set radio button selection based on property?

Mar 18, 2014 at 5:34 PM
Edited Mar 18, 2014 at 5:35 PM
I thought I had read somewhere in these posts that it is possible to set the radio button state based on a property (or, more specifically, a registry entry).

I currently have a property that is set based on a registry entry. Is it possible to set the state of a radio button based on this? Haven't quite figured it out if it is.

I know in general WixUI you can, but with wixextba it's a bit different, isn't it?
Mar 18, 2014 at 6:28 PM
It can be done but is a bit convoluted, here is an example that sets one of three buttons:
<!-- Predefine install type variables -->
<Variable Name="InstallTypeFull" Type="string" Value="0" />
<Variable Name="InstallTypeFullNoWeb" Type="string" Value="0" />
<Variable Name="InstallTypeBaseline" Type="string" Value="0" />

<!-- Allow install type from the command line -->
<Variable Name="InstallType" Type="numeric" Value="0" Persisted="yes" bal:Overridable="yes" />

<!-- Find previous install type (if any) -->
<util:RegistrySearch Id="InstallTypeExists" Root="HKLM" Key="SOFTWARE\Acme\MyApp" Value="InstallType" Variable="InstallTypeExists" Result="exists" />
<util:RegistrySearch Id="InstallType" Root="HKLM" Key="SOFTWARE\Acme\MyApp" Value="InstallType" Variable="InstallType" Condition="InstallTypeExists AND InstallType=0" After="InstallTypeExists" />

<util:RegistrySearch Id="InstallTypeFull" Root="HKLM" Key="SOFTWARE\Microsoft" Variable="InstallTypeFull" Result="exists" Condition="InstallType=1" After="InstallType" />
<util:RegistrySearch Id="InstallTypeFullNoWeb" Root="HKLM" Key="SOFTWARE\Microsoft" Variable="InstallTypeFullNoWeb" Result="exists" Condition="InstallType=2" After="InstallTypeFull" />
<util:RegistrySearch Id="InstallTypeBaseline" Root="HKLM" Key="SOFTWARE\Microsoft" Variable="InstallTypeBaseline" Result="exists" Condition="InstallType=3" After="InstallTypeFullNoWeb" />

<!-- Default to Full -->
<util:RegistrySearch Id="InstallTypeFullDefault" Root="HKLM" Key="SOFTWARE\Microsoft" Variable="InstallTypeFull" Result="exists" Condition="InstallTypeFull=0 AND InstallTypeFullNoWeb=0 AND InstallTypeBaseline=0" After="InstallTypeBaseline" />
You might find it easy to do in a BAFunction.