创建自定义对话框时 WiX 编译错误
我一直在尝试将自定义对话框插入到 WixUI_InstallDir
UI 序列中。我有一个名为 Product.wxs
的“主”文件,以及另一个名为 InstallTypeDlg.wxs
的文件中的自定义对话框 - 这两个文件都存在于 Installer.wixproj< /代码>。
在 InstallTypeDlg.wxs
中,我有以下内容:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Dialog Id="InstallTypeDlg" Width="370" Height="270" Title="Select Install Type">
<Control Id="InstallTypeSelection" Type="RadioButtonGroup" X="20" Y="55" Width="330" Height="120" Property="InstallType">
<RadioButtonGroup Property="InstallType">
<RadioButton Text="Type 01" Value="1" X="5" Y="0" Width="250" Height="15" />
<RadioButton Text="Type 02" Value="2" X="5" Y="20" Width="250" Height="15" />
</RadioButtonGroup>
</Control>
<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)">
<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.SetupTypeDlgBannerBitmap)" />
<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="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.SetupTypeDlgTitle)" />
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.SetupTypeDlgDescription)" />
<Control Id="TypicalText" Type="Text" X="60" Y="85" Width="280" Height="20" Text="!(loc.SetupTypeDlgTypicalText)" />
</Dialog>
</UI>
</Fragment>
</Wix>
我在 Product.wxs
中引用此自定义对话框:
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />
<UI Id="MyWixUI_InstallDir">
<UIRef Id="WixUI_InstallDir" />
<DialogRef Id="InstallTypeDlg" />
<Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="InstallTypeDlg" Order="4">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallTypeDlg">1</Publish>
</UI>
现在,当我编译此项目时,出现以下错误:
< code>InstallTypeDlg.wxs(8,0): 错误 LGHT0094: 在“Fragment:”部分中未解析对符号“Property:InstallType”的引用。
我不知道为什么。我是不是忘记了什么? :-/
我对 WiX 相当陌生,昨天才开始使用它。任何帮助将不胜感激。
我正在使用 Wix 3.5.2415.0。
I've been trying to insert a custom dialog into the WixUI_InstallDir
UI sequence. I have a "main" file named Product.wxs
and the custom dialog in another file named InstallTypeDlg.wxs
- both of which are present in Installer.wixproj
.
Within InstallTypeDlg.wxs
, I have the following:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Dialog Id="InstallTypeDlg" Width="370" Height="270" Title="Select Install Type">
<Control Id="InstallTypeSelection" Type="RadioButtonGroup" X="20" Y="55" Width="330" Height="120" Property="InstallType">
<RadioButtonGroup Property="InstallType">
<RadioButton Text="Type 01" Value="1" X="5" Y="0" Width="250" Height="15" />
<RadioButton Text="Type 02" Value="2" X="5" Y="20" Width="250" Height="15" />
</RadioButtonGroup>
</Control>
<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)">
<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.SetupTypeDlgBannerBitmap)" />
<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="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.SetupTypeDlgTitle)" />
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.SetupTypeDlgDescription)" />
<Control Id="TypicalText" Type="Text" X="60" Y="85" Width="280" Height="20" Text="!(loc.SetupTypeDlgTypicalText)" />
</Dialog>
</UI>
</Fragment>
</Wix>
I reference this custom dialog in Product.wxs
thus:
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />
<UI Id="MyWixUI_InstallDir">
<UIRef Id="WixUI_InstallDir" />
<DialogRef Id="InstallTypeDlg" />
<Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="InstallTypeDlg" Order="4">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallTypeDlg">1</Publish>
</UI>
Now, when I compile this project, I get the following error:
InstallTypeDlg.wxs(8,0): error LGHT0094: Unresolved reference to symbol 'Property:InstallType' in section 'Fragment:'.
I have no idea why. Have I forgotten something? :-/
I'm fairly new to WiX, having only picked it up yesterday. Any help would be much appreciated.
I am using Wix 3.5.2415.0.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许,您只需要在使用它之前定义该属性,即:
Probably, you just need to define that property before using it, i.e.: