installationwixwix4

How to Add custom dialog to Wix v4


I would like to add a custom dialog to Wix v4. I found a lot of resources on how to achieve that in v3 but none for v4.

So far I have:

<UI>
        <ui:WixUI Id="WixUI_InstallDir" />

        <!-- Define your custom dialog -->
        <Dialog Id="MyCustomDialog" Width="370" Height="270" Title="Advanced Options">
            <Control Id="Checkbox1" Type="CheckBox" X="20" Y="100" Width="290" Height="18"
                     Property="CHECKBOX1" Text="Option 1 Description" CheckBoxValue="1" />
            <Control Id="Checkbox2" Type="CheckBox" X="20" Y="120" Width="290" Height="18"
                     Property="CHECKBOX2" Text="Option 2 Description" CheckBoxValue="1" />

            <Control Id="OkButton" Type="PushButton" X="236" Y="243" Width="56" Height="17"
                     Default="yes" Text="OK" />
            <Control Id="CancelButton" Type="PushButton" X="304" Y="243" Width="56" Height="17"
                     Cancel="yes" Text="Cancel" />
        </Dialog>

        <!-- Navigation: Insert your custom dialog into the sequence -->
        <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="MyCustomDialog" Condition="1"/>
        <Publish Dialog="MyCustomDialog" Control="Back" Event="NewDialog" Value="InstallDirDlg" Condition="1"/>
        <Publish Dialog="MyCustomDialog" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Condition="1"/>
    </UI>

But MyCustomDialog is not showing. Any ideas?


Solution

  • Seems that you did not reference (load) your UI changes.

    <UI Id="MyCustomUI">
    ...
    

    And in your Product.wxs

    <UI>
      <UIRef Id="MyCustomUI" />
    </UI>