微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Wix 安装程序错误 2819:对话框 BrowseDlg 上的 Control PathEdit 需要一个链接到它的属性

如何解决Wix 安装程序错误 2819:对话框 BrowseDlg 上的 Control PathEdit 需要一个链接到它的属性

我想显示一个带有按钮的 PathEdit,您可以在其中更改对话框中的路径,但出现此错误Error 2819: Control PathEdit on dialog browseDlg needs a property linked to it.

对话框正在工作,但是当您单击按钮时,会弹出错误消息。 Database Connection Dialog

我做错了什么?

这是我在 WixUI_InstallDir_Custom 中添加内容

            <Publish Dialog="browseDlg" Control="OK" Property="_MysqLDirectorybrowseProperty" Value="MysqLTARGETDIR" Order="5"><![CDATA[WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>

            <Publish Dialog="DatabaseConnectionDlg" Control="MysqLDirectorybrowse" Property="_MysqLDirectorybrowseProperty" Value="MysqLTARGETDIR" Order="1">1</Publish>
            <Publish Dialog="DatabaseConnectionDlg" Control="MysqLDirectorybrowse" Event="SpawnDialog" Value="browseDlg" Order="2">1</Publish>

这里是完整的文件

    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <UI Id="WixUI_InstallDir_Custom">
            <TextStyle Id="WixUI_Font_normal" FaceName="Tahoma" Size="8" />
            <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
            <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />

            <Property Id="DefaultUIFont" Value="WixUI_Font_normal" />
            <Property Id="WixUI_Mode" Value="InstallDir" />


            <DialogRef Id="browseDlg" />
            <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" />
            <DialogRef Id="DatabaseConnectionDlg"/>

            <Publish Dialog="browseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3">1</Publish>
            <Publish Dialog="browseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4"><![CDATA[WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="browseDlg" Control="OK" Property="_MysqLDirectorybrowseProperty" Value="MysqLTARGETDIR" Order="5"><![CDATA[WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>

            <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>

            <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg">NOT Installed</Publish>
            <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>

            <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
            <Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
            <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
            <Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
            <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="DatabaseConnectionDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1" AND NOT WIX_UPGRADE_DETECTED</Publish>
            <Publish Dialog="InstallDirDlg" Control="Next" Property="_MysqLDirectorybrowseProperty" Value="MysqLTARGETDIR" Order="4">2</Publish>
            <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="5">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1" AND WIX_UPGRADE_DETECTED</Publish>
            <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_browseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
            <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="browseDlg" Order="2">1</Publish>

            <Publish Dialog="DatabaseConnectionDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg" Order="1">NOT Installed</Publish>
            <Publish Dialog="DatabaseConnectionDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="2">CONNECTION_STRING_VALID="1"</Publish>
            <Publish Dialog="DatabaseConnectionDlg" Control="MysqLDirectorybrowse" Property="_MysqLDirectorybrowseProperty" Value="MysqLTARGETDIR" Order="1">1</Publish>
            <Publish Dialog="DatabaseConnectionDlg" Control="MysqLDirectorybrowse" Event="SpawnDialog" Value="browseDlg" Order="2">1</Publish>

            <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg" Order="1">NOT Installed AND WIX_UPGRADE_DETECTED</Publish>
            <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="DatabaseConnectionDlg" Order="2">NOT Installed AND NOT WIX_UPGRADE_DETECTED</Publish>
            <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT WIX_UPGRADE_DETECTED</Publish>
            <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">Installed OR WIX_UPGRADE_DETECTED</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" />
        </UI>

        <UIRef Id="WixUI_Common" />
    </Fragment>
</Wix>

在此之后,我在 DatabaseConnectionDlg 对话框中添加以下行

                <Control Id="InstallPath"       Type="Text"             X="25"  Y="172" Width="75"  Height="17" Text="!(loc.DatabaseInstallPath)" />

                <Control Id="editInstallPath"   Type="PathEdit"         X="125" Y="169" Width="111" Height="15" Property="_MysqLDirectorybrowseProperty" Indirect="yes" />
                <Control Id="MysqLDirectorybrowse"      Type="PushButton"       X="240" Y="169" Width="56"  Height="17" Text="..." >
                    <Publish Property="_browseProperty" Value="_MysqLDirectorybrowseProperty"   Order="1"></Publish>
                    <Publish Event="SpawnDialog"        Value="browseDlg"                       Order="2"></Publish>
                </Control>

这里是完整的文件

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <UI>
            <TextStyle Id="ErrorText"
                         FaceName="Tahoma"
                         Size="8"
                         Blue="0"
                         Green="0"
                         Red="255" />

            <Property Id="DATABASE_VERSION_VALID"
                      Value="1" />

            <Dialog Id="DatabaseConnectionDlg" Width="370" Height="270" Title="!(loc.DatabaseConnectionDlg_Title)">
                <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
                <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" disabled="yes" Text="!(loc.WixUINext)">
                    <Condition Action="enable"><![CDATA[CONNECTION_STRING_VALID = "1" AND DATABASE_VERSION_VALID = "1"]]></Condition>
                    <Condition Action="disable"><![CDATA[CONNECTION_STRING_VALID = "0"]]></Condition>
                </Control>
                <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="no" Text="!(loc.WixUICancel)">
                    <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
                </Control>
                <Control Id="BannerBitmap"      Type="Bitmap"           X="0"   Y="0"   Width="370" Height="44" TabSkip="no" Text="!(loc.DatabaseConnectionDlgBannerBitmap)" />
                <Control Id="BannerLine"        Type="Line"             X="0"   Y="44"  Width="370" Height="2" />
                <Control Id="BottomLine"        Type="Line"             X="0"   Y="234" Width="370" Height="2" />
                <Control Id="Title"             Type="Text"             X="15"  Y="6"   Width="200" Height="15" Transparent="yes" noprefix="yes" Text="!(loc.DatabaseConnectionDlgTitle)" />
                <Control Id="Description"       Type="Text"             X="25"  Y="23"  Width="280" Height="15" Transparent="yes" noprefix="yes" Text="!(loc.DatabaseConnectionDlgDescription)" />
                <Control Id="Server"            Type="Text"             X="25"  Y="68"  Width="75"  Height="17" Text="!(loc.DatabaseConnectionDlgServer)" />
                <Control Id="editServer"        Type="Edit"             X="125" Y="65"  Width="111" Height="15" Property="CONNECTION_SERVER" />
                <Control Id="Schema"            Type="Text"             X="25"  Y="93"  Width="75"  Height="17" Text="!(loc.DatabaseConnectionDlgSchema)" />
                <Control Id="editSchema"        Type="Edit"             X="125" Y="91"  Width="111" Height="15" Property="CONNECTION_SCHEMA" />
                <Control Id="User"              Type="Text"             X="25"  Y="119" Width="75"  Height="17" Text="!(loc.DatabaseConnectionDlgUser)" />
                <Control Id="editUser"          Type="Edit"             X="125" Y="117" Width="111" Height="15" Property="CONNECTION_USER" />
                <Control Id="Password"          Type="Text"             X="25"  Y="146" Width="75"  Height="17" Text="!(loc.DatabaseConnectionDlgPassword)" />
                <Control Id="editPassword"      Type="Edit"             X="125" Y="143" Width="111" Height="15" Password="yes" Property="CONNECTION_PASSWORD" />
                <Control Id="InstallPath"       Type="Text"             X="25"  Y="172" Width="75"  Height="17" Text="!(loc.DatabaseInstallPath)" />

                <Control Id="editInstallPath"   Type="PathEdit"         X="125" Y="169" Width="111" Height="15" Property="_MysqLDirectorybrowseProperty" Indirect="yes" />
                <Control Id="MysqLDirectorybrowse"      Type="PushButton"       X="240" Y="169" Width="56"  Height="17" Text="..." >
                    <Publish Property="_browseProperty" Value="_MysqLDirectorybrowseProperty"   Order="1"></Publish>
                    <Publish Event="SpawnDialog"        Value="browseDlg"                       Order="2"></Publish>
                </Control>

                <Control Id="VerifyButton"      Type="PushButton"   X="125" Y="196" Width="111" Height="16" Text="!(loc.DatabaseConnectionDlgVerify)" Default="yes">
                    <Publish Event="DoAction"   Value="CA_VerifyConnection">1</Publish>
                    <Publish Property="TEMP_CONNECTION_VERIFIED" Value="[CONNECTION_STRING_VALID]">1</Publish>
                    <Publish Property="CONNECTION_STRING_VALID" Value="[TEMP_CONNECTION_VERIFIED]"/>
                    <Publish Property="TEMP_VERSION_VERIFIED" Value="[DATABASE_VERSION_VALID]">1</Publish>
                    <Publish Property="DATABASE_VERSION_VALID" Value="[TEMP_VERSION_VERIFIED]"/>
                </Control>
                <Control Id="DBVersion"     Type="Text" Height="32" Width="320" X="25" Y="190" Nowrap="no" Text="{\ErrorText}!(loc.DatabaseConnectionDlgVersionError)">
                    <Condition Action="hide"><![CDATA[DATABASE_VERSION_VALID = "1"]]></Condition>
                    <Condition Action="show"><![CDATA[DATABASE_VERSION_VALID = "0"]]></Condition>
                </Control>
            </Dialog>
        </UI>
    </Fragment>
</Wix>

感谢您的帮助。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。