[wix-users] Conditions on Feature Set

Brian Enderle brianke at gmail.com
Tue Aug 2 07:25:29 PDT 2016


I have the following Feature group that gets installed when a user selects
to do a 'Server' installation (vs a 'Client') installation:


    <!-- FoxPro Service Components to install, will only install if Server
option is selected in ClientServerDlg.wxs -->
    <Feature Id="ServiceFeature"
             Title="FoxProConnectService"
             Level="1">

      <ComponentGroupRef Id="FoxProConnectServiceComponents" />
      <ComponentGroupRef Id="FoxProConfig" />
      <ComponentGroupRef Id="CLRComponents" />
      <ComponentRef Id="UpdateConfigFile_FoxPro" />

    </Feature>


If the option to do a 'Server' install is selected, I would like to do a
check to see that FoxPro DLL is actually installed by searching the
registry.  Here is how I would do it at installer startup (under the
Product tag):

    <!-- check for existence of FoxPro OLEDB -->
    <Property Id="FOXPRO_OLEDB">
      <RegistrySearch Id="FoxProOLEDB"
                      Root="HKCR"

Key="TypeLib\{50BAEECA-ED25-11D2-B97B-000000000000}\1.0\0\win32"
                      Type="raw" />
    </Property>

    <!-- Don't care where FoxPro OLE DB is installed, just that it is -->
    <Condition Message="FoxPro OLEDB (VFPOLEDB) is required for this
product.">
      <![CDATA[Installed or (FOXPRO_OLEDB >< "")]]>
    </Condition>


However, checking at startup will cause the program to exit before being
able to select the Client/Server option (done after InstallDirDlg).

Is it possible to add this condition to the "ServiceFeature" group and
maintain the Message or add this condition check to the 'Next' button on
the ClientServerDlg?  The big thing I would like to have is the pop-up
message that tells the user that the FoxPro DLL is missing.



Here is the code for the Next button and the RadioButtons on the
ClientServerDlg:


        <!-- Next button takes us to the Account Info dialog -->
        <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56"
Height="17" Default="yes" Text="!(loc.WixUINext)">
          <!-- If Client option is selected, remove the FoxPro service from
installation -->
          <Publish Event="Remove"
Value="ServiceFeature">CLIENT_SERVER_INSTALL = 0</Publish>
        </Control>

        .  .  .  .

        <!-- Choose Client or Server installation -->
        <Control Id="ClientServerRadioButtonGroup" Type="RadioButtonGroup"
X="30" Y="63" Width="200" Height="100" Property="CLIENT_SERVER_INSTALL"
Text="Select Client or Server installation">
          <RadioButtonGroup Property="CLIENT_SERVER_INSTALL">
            <RadioButton Value="1" X="0" Y="0" Width="200" Height="10"
Text="Server" />
            <RadioButton Value="0" X="0" Y="20" Width="200" Height="10"
Text="Client" />
          </RadioButtonGroup>
        </Control>




TIA

Brian

If you can't explain it simply, you don't understand it well enough.  -
Albert Einstein


More information about the wix-users mailing list