Кнопки Wix Toolset с условиями, которые не появляются, если не отображаются - PullRequest
0 голосов
/ 05 ноября 2018

У меня есть три кнопки в моем пользовательском диалоговом окне 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>
...