Andriy
Andriy

Reputation: 133

How to choose which WIX dialog to show OnExit based on condition

I have two WIX dialogs in my setup project

Final form which is to be shown when installer terminates with status 'success'

<Dialog Id="FinishedForm">
   ...
</Dialog>

and page to show several slides about our Product.

<Dialog Id="IntroductionTourPage">
   ...
   <Control Id="SkipTourButton" Type="PushButton">
      <Publish Event="NewDialog" Value="FinishedForm">1</Publish>
   </Control>
   ...
</Dialog>

I want IntroductionTourPage is only to be shown after product is installed(not upgraded or removed), but I do not know how to do that. I tried

<InstallUISequence>
    <Show Dialog="FinishedForm" OnExit="success">Condition</Show>
    <Show Dialog="IntroductionTourPage" OnExit="success">NOT Condition</Show>
</InstallUISequence>

but it is not valid in Wix so it this approach failed. Then I tried

<InstallUISequence>
    <Show Dialog="FinishedForm" Sequence="1">Condition</Show>
    <Show Dialog="IntroductionTourPage" Sequence="2">NOT Condition</Show>
</InstallUISequence>

it didn't work. I tried then

<InstallUISequence>
    <Show Dialog="FinishedForm" OnExit="success"/>
    <Show Dialog="IntroductionTourPage" Before="FinishedForm">Condition</Show>
</InstallUISequence>

but it is not valid in Wix as well.

Now I want to try smth like:

<InstallUISequence>
    <Custom Action="CA_ChooseAndShowDialogBasedOnCondition" OnExit="success"/>
</InstallUISequence>

but I can't find any example how to show Wix dialogs from CA.

Any ideas?

Thanks in advance, Andriy

Upvotes: 2

Views: 1726

Answers (1)

Vinoth
Vinoth

Reputation: 1995

I have something different solution for you. Try this if you found this is suitable for your requirement.

Add all controls in your FinishedForm to IntroductionTourPage. Use IntroductionTourPage as the Success exit dialog. Display the controls in IntroductionTourPage dialog based on the condition.

Now IntroductionTourPage will act as both FinishedForm and IntroductionTourPage as per the condition. You can use FinishedForm dialog from IntroductionTourPage if required.

Example: Title Control in IntroductionTourPage

   <Control Id="Title" Type="Text" X="188" Y="22" Width="330" Height="22" Transparent="yes" NoPrefix="yes" Text="Welcome to the IntroductionTourPage" >
            <Condition Action="hide">Condition</Condition>
   </Control>
  <Control Id="FinishTitle" Type="Text" X="188" Y="15" Width="316" Height="22" Transparent="yes" NoPrefix="yes" Text="Completed the Sample Setup Wizard" Hidden="yes">
            <Condition Action="show">Condition</Condition>
  </Control>

Upvotes: 1

Related Questions