I have created a dialog called ApiKeyDlg which I have nested in the UI. The UI is a direct copy of the built-in WixUI_InstallDir with some minor tweaks.
I have added the dialogref and the publish elements, but for some reason the ApiKeyDlgdialog does not show. Neither candle.exe or light.exe display any errors, and the MSI file installs perfectly, just without showing my custom dialog.
There are many questions similar to this one on Stackoverflow, I have read 8 or 10 of them and haven't got any closer to answering my own. I have also read this guide (https://wixtoolset.org/documentation/manual/v3/wixui/wixui_customizations.html), specifically the last paragraph about "Inserting a custom dialog into a built-in dialog set" but something isn't clicking and I'm not getting any further.
The order (for an installation) should be:
- Welcome
- License
- ApiKey
- Verify
- Exit (complete)
<UI Id="MyWixUI_InstallDir">
<TextStyle Id="WixUI_Font_Normal" FaceName="Calibri" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Calibri" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Calibri" Size="9" Bold="yes" />
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<Property Id="WixUI_Mode" Value="InstallDir" />
<Dialog Id="ApiKeyDlg" Width="370" Height="270" Title="Organisation ID required" Modeless="yes">
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Default="yes" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Description" Type="Text" X="135" Y="70" Width="220" Height="20" Transparent="yes" NoPrefix="yes" Text="Please enter the ID of the organisation to which this device belongs" />
<Control Id="Title" Type="Text" X="135" Y="20" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="Organisation ID" />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Disabled="yes" TabSkip="yes" Text="!(loc.WixUIBack)" />
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Disabled="yes" TabSkip="yes" Text="!(loc.WixUINext)" />
<Control Id="ActionData" Type="Text" X="135" Y="125" Width="220" Height="30" Transparent="yes" NoPrefix="yes">
<Subscribe Event="ActionData" Attribute="Text" />
</Control>
<Control Id="ActionText" Type="Text" X="135" Y="100" Width="220" Height="20" Transparent="yes" NoPrefix="yes">
<Subscribe Event="ActionText" Attribute="Text" />
</Control>
</Dialog>
<DialogRef Id="ApiKeyDlg" />
<DialogRef Id="DiskCostDlg" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FatalError" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
<DialogRef Id="PrepareDlg" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="ApiKeyDlg">LicenseAccepted = "1"</Publish>
<Publish Dialog="ApiKeyDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
<Publish Dialog="ApiKeyDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1<!--Some text field conditon here maybe?--></Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="ApiKeyDlg" Order="1">NOT Installed</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">Installed AND PATCH</Publish>
<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
<Property Id="ARPNOMODIFY" Value="1" />
<!--
<InstallUISequence>
<Show Dialog="ApiKeyDlg" Before="VerifyReadyDlg" Overridable="no" />
</InstallUISequence>
-->
</UI>
<UIRef Id="MyWixUI_InstallDir" />
<UIRef Id="WixUI_Common" />
<UIRef Id="MyWixUI_InstallDir" />in your<Product>? I'm a little confused about the UIRefs at the bottom of your code snippet. You can look at your msi in Orca.exe and see if your dialog shows up in the Dialog table or if the ControlEvent table shows LicenseAgreementDlg | Next | New Dialog | ApiKeyDlg entry. If those aren't showing up then there's an issue with linking in your custom dialog into the installer and you're still referencing the default dialog somewhere.