Ezequiel
Ezequiel

Reputation: 71

I want to disable the Next button if no features were selected to install

this is mi installer and i need disable the next button if no features were selected to install.

<Feature Id="App1" Title="App 1" Level="1" AllowAdvertise='no' InstallDefault='local'>
    <Condition Level="0">INSTALL_FEATURES = 0</Condition>
    <ComponentRef Id="App1" />
</Feature>

<Feature Id="App2" Title="App 2" Level="1" AllowAdvertise='no' InstallDefault='local'>
    <Condition Level="0">INSTALL_FEATURES = 0</Condition>
    <ComponentRef Id="App2" />
</Feature>

<UIRef Id="WixUI_FeatureTree"/>
<UIRef Id="WixUI_ErrorProgressText" />

thanks!

Upvotes: 2

Views: 1065

Answers (2)

Dominic Jonas
Dominic Jonas

Reputation: 5005

If you have a custom UI, you can give that Control two Conditions:

          <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="[ButtonText_Next]">
            <Publish Event="NewDialog" Value="HtVerifyReadyDlg">1</Publish>
            <Condition Action="disable"><![CDATA[NOT(&App1=3 OR &App2=3)]]></Condition>
            <Condition Action="enable"><![CDATA[(&App1=3 OR &App2=3)]]></Condition>
          </Control>

Upvotes: 0

Christopher Painter
Christopher Painter

Reputation: 55581

MSI native UI doesn't allow you to enable and disable a control in the way you want. The best you can do is write event conditions that check that if none of your features are selected to display a modal dialog with an error message otherwise display the next dialog. Be sure to consider the ramifications of a maintenance / change and/or upgrade scenario.

Upvotes: 1

Related Questions