我的自定义wix对话框中有三个按钮:安装,修复,卸载。它们中的每一个都有根据系统状态显示/隐藏每个按钮的条件。但是,当对话框打开时,按钮不会立即呈现,只有当我将鼠标悬停在每个按钮上时,这些按钮才会出现。细细品味之后,一切都会按预期进行。
我正在使用Wix v3.11
对话框的代码如下:
<?xml version="1.0" encoding="UTF-8" ?>
<Include>
<Binary Id="Install" SourceFile="install.jpg" />
<Binary Id="InstallInactive" SourceFile="install-inactive.jpg" />
<Binary Id="Repair" SourceFile="repair.jpg" />
<Binary Id="RepairInactive" SourceFile="repair-inactive.jpg" />
<Binary Id="Uninstall" SourceFile="uninstall.jpg" />
<Binary Id="UninstallInactive" SourceFile="uninstall-inactive.jpg" />
<Dialog Id="MyWelcomeDlg" Width="370" Height="235" Title="!(loc.MaintenanceTypeDlg_Title)">
<Control Id="MyInstallImage" Type="Bitmap" X="57" Y="140" Width="48" Height="48" Text="Install">
<Condition Action="hide">Installed</Condition>
</Control>
<Control Id="MyInstallButtonInactive" Type="Bitmap" X="57" Y="140" Width="48" Height="48" Text="InstallInactive" Hidden="yes">
<Condition Action="show">Installed</Condition>
</Control>
<Control Id="MyInstallButton" Type="PushButton" X="53" Y="195" Width="60" Height="22" Text="{\ButtonText}Install">
<Condition Action="disable">Installed</Condition>
<Condition Action="default">NOT Installed</Condition>
</Control>
<Control Id="MyRepairImage" Type="Bitmap" X="157" Y="140" Width="48" Height="48" Text="Repair">
<Condition Action="hide">NOT Installed OR ARPNOREPAIR</Condition>
</Control>
<Control Id="MyRepairButtonInactive" Type="Bitmap" X="157" Y="140" Width="48" Height="48" Text="RepairInactive" Hidden="yes">
<Condition Action="show">NOT Installed OR ARPNOREPAIR</Condition>
</Control>
<Control Id="MyRepairButton" Type="PushButton" X="153" Y="195" Width="60" Height="22" Text="{\ButtonText}Repair" Hidden="no">
<Publish Property="WixUI_InstallMode" Value="Repair">1</Publish>
<Condition Action="disable">NOT Installed OR ARPNOREPAIR</Condition>
</Control>
<Control Id="MyUninstallImage" Type="Bitmap" X="257" Y="140" Width="48" Height="48" Text="Uninstall">
<Condition Action="hide">NOT Installed</Condition>
</Control>
<Control Id="MyUninstallButtonInactive" Type="Bitmap" X="257" Y="140" Width="48" Height="48" Text="UninstallInactive" Hidden="yes">
<Condition Action="show">NOT Installed</Condition>
</Control>
<Control Id="MyUninstallButton" Type="PushButton" X="253" Y="195" Width="60" Height="22" Text="{\ButtonText}Uninstall" Hidden="no">
<Publish Property="WixUI_InstallMode" Value="Remove">1</Publish>
<Condition Action="disable">NOT Installed</Condition>
<Condition Action="default">Installed</Condition>
</Control>
<Control Id="Cancel" Type="PushButton" X="307" Y="230" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)" Hidden="yes">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="235" TabSkip="no" Text="Background" />
</Dialog>
</Include>