Incorrect layout of buttons in MSI table
When using the UI.wixext dialogs directly with wixl the MSI gives an error message with "Error 2834: The next pointers on the dialog BrowseDlg do not form a single loop"
.
I have tracked it down to this sequence in BrowseDlg.wxs
:
<Dialog Id="BrowseDlg" Width="370" Height="270" Title="!(loc.BrowseDlg_Title)">
<Control Id="PathEdit" Type="PathEdit" X="25" Y="202" Width="320" Height="18" Property="_BrowseProperty" Indirect="yes" />
<Control Id="OK" Type="PushButton" X="240" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUIOK)" />
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)" />
...
And similar for CustomizeDlg.wxs
:
<Dialog Id="CustomizeDlg" Width="370" Height="270" Title="!(loc.CustomizeDlg_Title)" TrackDiskSpace="yes">
<Control Id="Tree" Type="SelectionTree" X="25" Y="85" Width="175" Height="115" Property="_BrowseProperty" Sunken="yes" TabSkip="no" Text="!(loc.CustomizeDlgTree)" />
...
<Control Id="Back" Type="PushButton" X="192" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
<Control Id="Next" Type="PushButton" X="248" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" />
...
The problem seems to be that the MSI consistency check assumes that the first (focusable?) control in the dialog is the next/back buttons. For BrowseDlg.wxs
the fix is to move the PathEdit
control down below the buttons, like this:
<Dialog Id="BrowseDlg" Width="370" Height="270" Title="!(loc.BrowseDlg_Title)">
<Control Id="OK" Type="PushButton" X="240" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUIOK)" />
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)" />
<Control Id="PathEdit" Type="PathEdit" X="25" Y="202" Width="320" Height="18" Property="_BrowseProperty" Indirect="yes" />
...
For the CustomizeDlg
, moving the buttons up under the <Dialog>
tag also fixes it, but reveals another issue. The Default
property does not affect the tab order, meaning that the default button is not focused as expected. Switching the Back/Next buttons will fix the issue, but it should not be required.
For now I found a workaround, but it would be nice if the UI.wixext
files worked as-is.