问题
I would like to have two different exit dialogs based on the version of the VersionMsi property in order to utilize the hyperlink control for the exit dialog. More information here.
I'm using a customized version of WIX's InstallDir_UI extension for my install process. Since I would like to optionally support the hyperlink control if available, I have created two different dialogs:
<Dialog Id="NonHyperlinkExit" Width="370" Height="270" Title="!(loc.ExitDialog_Title)">
<Control Id="Finish" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Cancel="yes" Text="!(loc.WixUIFinish)" />
...
<Control Id="HowToLink" Type="Text" X="135" Y="175" Width="220" Height="10" Transparent="yes" NoPrefix="yes" Text="!(loc.InfoUrl)" />
...
</Dialog>
<Dialog Id="HyperlinkExit" Width="370" Height="270" Title="!(loc.ExitDialog_Title)">
<Control Id="Finish" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Cancel="yes" Text="!(loc.WixUIFinish)" />
...
<Control Id="HowToHyperLink" Type="Hyperlink" X="135" Y="175" Width="220" Height="10" Text="!(loc.InfoLink)" />
...
</Dialog>
I've then modified the UI publish statements to support those dialogs to something like this:
<Publish Dialog="NonHyperlinkExit" Control="Finish" Event="EndDialog" Value="Return" Order="998"><![CDATA[VersionMsi < "5.0"]]></Publish>
<Publish Dialog="HyperlinkExit" Control="Finish" Event="EndDialog" Value="Return" Order="999"><![CDATA[VersionMsi >= "5.0"]]></Publish>
When running this, I get the following errors:
error LGHT0204: ICE20: Exit dialog/action not found in 'AdminUISequence' Sequence Table.
error LGHT0204: ICE82: This action HyperlinkExit has duplicate sequence number -1 in the table InstallUISequence
So I've tried to modify the InstallUISequence instead, but with little help. Tried this:
<InstallUISequence>
...
<Show Dialog="NonHyperlinkExit" Before="HyperlinkExit"><![CDATA[VersionMsi < "5.0"]]></Show>
<Show Dialog="HyperlinkExit" OnExit="success"><![CDATA[VersionMsi >= "5.0"]]></Show>
</InstallUISequence>
But this only give me the following error:
error LGHT0177: The InstallUISequence table contains an action 'NonHyperlinkExit' that is scheduled to come before or after action 'HyperlinkExit',
which is a special action which only occurs when the installer terminates.
These special actions can be identified by their negative sequence numbers.
Please schedule the action 'NonHyperlinkExit' to come before or after a different action.
Any ideas on how to create conditional exit dialogs would be appreciated.
回答1:
MSI supports only one exit dialog per state (e.g., success). You could use a custom action instead that showed the the appropriate dialog.
回答2:
You can also use a custom action to dynamically inject controls onto a dialog only when it's supported. See:
Dynamic Windows Installer UI
来源:https://stackoverflow.com/questions/6411462/conditional-choose-between-two-exit-dialog-when-using-wixs-installdir-ui-extens