[英]Windows Installer Toolkit (WIX) Dialog Condition not working
这件事使我发疯。
我所拥有的是一个自定义退出对话框,上面带有一些控件。 来源如下:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Dialog Id="MyExitDialog" Width="370" Height="220" Title="!(loc.ExitDialog_Title)">
<Control Id="Finish" Type="PushButton" X="236" Y="200" Width="56" Height="17" Default="yes" Cancel="yes" Text="!(loc.WixUIFinish)" />
<Control Id="Cancel" Type="PushButton" X="304" Y="200" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUICancel)" />
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.DiskCostDlgBannerBitmap)" />
<Control Id="InstallText" Type="Text" X="25" Y="53" Width="330" Height="50" Text="Product [ProductName] was successfully installed" >
<Condition Action="show">NOT Installed</Condition>
</Control>
<Control Id="UninstallText" Type="Text" X="25" Y="53" Width="330" Height="50" Text="Product [ProductName] was successfully removed." >
<Condition Action="show">Installed</Condition>
</Control>
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<Control Id="Back" Type="PushButton" X="180" Y="200" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUIBack)" />
<Control Id="BottomLine" Type="Line" X="0" Y="190" Width="370" Height="0" />
<Control Id="Description" Type="Text" X="25" Y="23" Width="340" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.ExitDialogDescription)" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.ExitDialogTitle)" />
<Control Id="LaunchAfterExitCheckBox" Type="CheckBox" X="25" Y="145" Width="330" Height="18" CheckBoxValue="1" Property="LAUNCHAFTEREXIT" Text="Run application after installation" >
<Condition Action="show">NOT Installed</Condition>
</Control>
</Dialog>
<InstallUISequence>
<Show Dialog="MyExitDialog" OnExit="success" Overridable="yes" />
</InstallUISequence>
<AdminUISequence>
<Show Dialog="MyExitDialog" OnExit="success" Overridable="yes" />
</AdminUISequence>
</UI>
</Fragment>
</Wix>
那些熟悉WIX源代码的人会很容易认识到,我已经克隆了WIX中包含的ExitDialog,并赋予它几乎与所有其他对话框相同的布局(顶部为水平横幅),以解决“ letterbox”错误(Windows)通过控件闪闪发光的背景)。 现在的问题是,安装和卸载时确实出现了“启动应用程序”复选框,看来情况没有任何效果。 但是,通过设置LAUNCHCONDITION属性,我可以成功勾选和取消勾选该复选框,所以这是一件活的事。 整个问题有些怪异,因为再往前10行,我使用完全相同的条件在“ InstallText”和“ UninstallText”之间切换文本,所以效果很好。
这是ExitDialog中的原始代码:
<Control Id="OptionalCheckBox" Type="CheckBox" X="135" Y="190" Width="220" Height="40" Hidden="yes" Property="WIXUI_EXITDIALOGOPTIONALCHECKBOX" CheckBoxValue="1" Text="[WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT]">
<Condition Action="show">WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT AND NOT Installed</Condition>
</Control>
好的,它们还有另一个条件AND,在我的项目中不存在,但是那又是什么呢? 我的病情应该很好,但事实并非如此。 我已经盯着那几行看了几个小时了,尝试了这一点,但没有成功。
我在想什么???
谢谢,阿明。
您的条件取决于“显示”操作。 但是,所有控件都开始可见,因此您真正需要的是隐藏它们的操作。 在具有互补条件的每个控件上同时具有两个动作(也就是保持您的显示动作),这不是一个坏主意,尽管在这种情况下,这可能无关紧要。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.