0
votes

What I'm trying to do is if a certain registry value is not found on the machine, a custom dialog will be shown to them where they can choose the value that they want to add. The problem is when they select that value and click Next, then click Back, since the property relating to that registry is already filled, the custom dialog will not be shown anymore unless they re-run the installer. I hope I'm clear enough, here're the snippets of the code.

<Property Id="REG_VAL" Value="NoValueFound">
  <RegistrySearch ... />
</Property>

<Component ...>
  <RegistryValue Value="[REG_VAL]".../>
</Component>

<UI...>
  <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="ChooseValueDlg">
    <![CDATA[(REG_VAL="NoValueFound")]]>  
  </Publish>

  <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">
    <![CDATA[(REG_VAL<>"NoValueFound")]]>
  </Publish>

  <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="ChooseValueDlg">
    <![CDATA[(REG_VAL="NoValueFound")]]>
  </Publish>

  <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">
    <![CDATA[(REG_VAL<>"NoValueFound")]]>
  </Publish>
</UI>

<UI>
  <Dialog Id="ChooseValueDlg" ...>
    <Control Id="rdoBtnGrp" Type="RadioButtonGroup" Property="REG_VAL" ...>
      <RadioButtonGroup Property="REG_VAL">
        <RadioButton Value="NoValueFound" .../>
        <RadioButton Value="Value1" .../>
        <RadioButton Value="Value2" .../>
      </RadioButtonGroup>
    </Control>
  </Dialog>
</UI>
1

1 Answers

1
votes

You need to save the results of the registry search into two properties and bind one of them to the UI for editing by the user and one used as conditions for the mutually exclusive control events. This way if you start off with both null the dialog gets displayed and then when the user enters data into one the other is still null and the dialog will still be displayed.

BTW I like to ditch the unneeded CDATA and use PROPERTY and Not PROPERTY. I think it's easier to read.