我将当前的安装程序从 wix 3 升级到 wix 5,现在我的自定义对话框显示错误: “LiecenseAgreementDlg 的打印按钮没有在 ControlEvent 表中定义事件。它是一个不执行任何操作的按钮”
如果我尝试更改它或创建新的自定义对话,该对话不会显示在我的用户界面中。
我尝试了两个 UI
这会导致“打印”按钮错误:
<!--
First-time install dialog sequence:
- WixUI_WelcomeDlg
- WixUI_LicenseAgreementDlg
- WixUI_CustomizeDlg
- WixUI_VerifyReadyDlg
- WixUI_DiskCostDlg
Maintenance dialog sequence:
- WixUI_MaintenanceWelcomeDlg
- WixUI_MaintenanceTypeDlg
- WixUI_CustomizeDlg
- WixUI_VerifyReadyDlg
Patch dialog sequence:
- WixUI_WelcomeDlg
- WixUI_VerifyReadyDlg
-->
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<Fragment>
<UI Id="WixUI_EAS">
<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="FeatureTree" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FatalError" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
<DialogRef Id="PrepareDlg" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999" />
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg" Condition="NOT Installed" />
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Condition="Installed AND PATCH" />
<Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" />
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="CustomizeDlg" Condition="LicenseAccepted = "1"" />
<Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="1" Condition="Installed" />
<Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg" Order="2" Condition="NOT Installed" />
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="EasSettingDlg" />
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="EasSettingDlg" Order="1" Condition="NOT Installed OR WixUI_InstallMode = "Change"" />
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2" Condition="Installed AND NOT PATCH" />
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3" Condition="Installed AND PATCH" />
<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg" />
<Publish Dialog="MaintenanceTypeDlg" Control="ChangeButton" Event="NewDialog" Value="CustomizeDlg" />
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg" />
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg" />
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg" />
<Publish Dialog="EasSettingDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="2" Condition="NOT Installed" />
<Publish Dialog="EasSettingDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" />
<Publish Dialog="EasSettingDlg" Control="Cancel" Event="NewDialog" Value="ExitDialog"></Publish>
<Dialog Id="EasSettingDlg" Width="370" Height="270" Title="[ProductName] Setup">
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.LicenseAgreementDlgBannerBitmap)" />
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Description" Type="Text" X="25" Y="23" Width="340" Height="15" Transparent="yes" NoPrefix="yes" Text="Set general setup options" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="{\WixUI_Font_Title}General Options" />
<Control Id="RestoreConfig" Type="CheckBox" X="20" Y="71" Width="330" Height="18" CheckBoxValue="1" Property="RESTORECONFIGFILE" Text="Reset all settings and configuration files to factory defaults" />
<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" Default="yes" Text="!(loc.WixUINext)" />
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)" />
</Dialog>
</UI>
<UIRef Id="WixUI_Common" />
</Fragment>
</Wix>
这个甚至没有显示我的自定义对话:
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<Fragment>
<UI Id="MyCustomUI">
<ui:WixUI Id="WixUI_InstallDir" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER"/>
<!-- Define your custom dialog -->
<Dialog Id="MyCustomDialog" Width="370" Height="270" Title="[ProductName] Setup">
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.LicenseAgreementDlgBannerBitmap)" />
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Description" Type="Text" X="25" Y="23" Width="340" Height="15" Transparent="yes" NoPrefix="yes" Text="Set general setup options" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="{\WixUI_Font_Title}General Options" />
<Control Id="RestoreConfig" Type="CheckBox" X="20" Y="71" Width="330" Height="18" CheckBoxValue="1" Property="RESTORECONFIGFILE" Text="Reset all settings and configuration files to factory defaults" />
<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" Default="yes" Text="!(loc.WixUINext)" />
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)" />
</Dialog>
<!-- Navigation: Insert your custom dialog into the sequence -->
<Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="MyCustomDialog"/>
<Publish Dialog="MyCustomDialog" Control="Back" Event="NewDialog" Value="InstallDirDlg"/>
<Publish Dialog="MyCustomDialog" Control="Next" Event="NewDialog" Value="VerifyReadyDlg"/>
<Publish Dialog="MyCustomDialog" Control="Cancel" Event="NewDialog" Value="ExitDialog"/>
</UI>
</Fragment>
</Wix>
这是我的 Product.wxs 的 UI 部分:
<UI>
<UIRef Id="MyCustomUI" />
</UI>
您需要阅读 v3 到 v4 和 v4 到 v5 的升级文档。特别是来自 转换自定义 WixUI 对话框集
由于 WiX v4 支持特定于平台的自定义操作,因此自定义 WixUI 对话框集(尤其是在添加和删除对话框时)需要小心。 WixUI 文档描述了创建新的自定义对话框集时要执行的操作。将使用 WiX v3 创建的自定义对话框集转换为 WiX v4 时,您需要进行相同类型的更改。关键点是隔离任何调用自定义操作以创建特定于平台的变体的 DoAction 控件事件。
更多详细信息请参阅升级指南。