Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
User interface Wix UI条件最佳实践_User Interface_Wix_Windows Installer - Fatal编程技术网

User interface Wix UI条件最佳实践

User interface Wix UI条件最佳实践,user-interface,wix,windows-installer,User Interface,Wix,Windows Installer,我用Wix编写了一个相当复杂的安装程序,它有许多自定义对话框选项,这些选项基于您要安装的组件。通常,默认设置是可以的,因此无人参与的安装会成功,但是这种定制会有所帮助 我想知道的是,Wix中做UI条件的最佳实践是什么?我注意到Wix会计算所有的标记,而不管最后一个标记的计算结果是否为true,这导致了大量类似这样的代码: <Publish Dialog="Questions" Control="Next" Event="NewDialog" Value="Component1Questio

我用Wix编写了一个相当复杂的安装程序,它有许多自定义对话框选项,这些选项基于您要安装的组件。通常,默认设置是可以的,因此无人参与的安装会成功,但是这种定制会有所帮助

我想知道的是,Wix中做UI条件的最佳实践是什么?我注意到Wix会计算所有的
标记,而不管最后一个标记的计算结果是否为true,这导致了大量类似这样的代码:

<Publish Dialog="Questions" Control="Next" Event="NewDialog" Value="Component1Questions" Order="1">INSTALLCOMPONENT1</Publish>
<Publish Dialog="Questions" Control="Next" Event="NewDialog" Value="Component2Questions" Order="2">NOT INSTALLCOMPONENT1 AND INSTALLCOMPONENT2</Publish>
<Publish Dialog="Questions" Control="Next" Event="NewDialog" Value="Component3Questions" Order="3">NOT INSTALLCOMPONENT1  AND NOT INSTALLCOMPONENT2 AND INSTALLCOMPONENT3</Publish>
<Publish Dialog="Questions" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">NOT INSTALLCOMPONENT1  AND NOT INSTALLCOMPONENT2 AND NOT INSTALLCOMPONENT3</Publish>
<Publish Dialog="Questions" Control="Next" Event="NewDialog" Value="Component1Questions" Order="4">INSTALLCOMPONENT1</Publish>
<Publish Dialog="Questions" Control="Next" Event="NewDialog" Value="Component2Questions"  Order="3">INSTALLCOMPONENT2</Publish>
<Publish Dialog="Questions" Control="Next" Event="NewDialog" Value="Component3Questions" Order="2">INSTALLCOMPONENT3</Publish>
<Publish Dialog="Questions" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="1">1</Publish>
INSTALLCOMPONENT1
非安装组件1和安装组件2
非安装组件1、非安装组件2和安装组件3
非安装组件1和非安装组件2和非安装组件3

类似地,在每个对话框的“back”部分。这是最佳实践吗?有没有一种方法可以缩短对Publish元素的求值,并使用第一个返回true的元素?

您已经在使用Publish/@Order元素来简化代码,但是我建议尽可能明确

无论如何,您都可以简化逻辑,而不必担心顺序值

<Publish ... Value="Component1Questions">CMP1 And Not (CMP2 Or CMP3)</Publish>
<Publish ... Value="Component2Questions">CMP2 And Not (CMP1 Or CMP3)</Publish>
<Publish ... Value="Component3Questions">CMP3 And Not (CMP1 Or CMP2)</Publish>
<Publish ... Value="VerifyReadyDlg">Not (CMP1 Or CMP2 Or CMP3)</Publish>
CMP1和非(CMP2或CMP3)
CMP2和非(CMP1或CMP3)
CMP3和非(CMP1或CMP2)
非(CMP1或CMP2或CMP3)

我仍然不知道这是否是一个好的做法,但我得到了类似这样的结果:

<Publish Dialog="Questions" Control="Next" Event="NewDialog" Value="Component1Questions" Order="1">INSTALLCOMPONENT1</Publish>
<Publish Dialog="Questions" Control="Next" Event="NewDialog" Value="Component2Questions" Order="2">NOT INSTALLCOMPONENT1 AND INSTALLCOMPONENT2</Publish>
<Publish Dialog="Questions" Control="Next" Event="NewDialog" Value="Component3Questions" Order="3">NOT INSTALLCOMPONENT1  AND NOT INSTALLCOMPONENT2 AND INSTALLCOMPONENT3</Publish>
<Publish Dialog="Questions" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">NOT INSTALLCOMPONENT1  AND NOT INSTALLCOMPONENT2 AND NOT INSTALLCOMPONENT3</Publish>
<Publish Dialog="Questions" Control="Next" Event="NewDialog" Value="Component1Questions" Order="4">INSTALLCOMPONENT1</Publish>
<Publish Dialog="Questions" Control="Next" Event="NewDialog" Value="Component2Questions"  Order="3">INSTALLCOMPONENT2</Publish>
<Publish Dialog="Questions" Control="Next" Event="NewDialog" Value="Component3Questions" Order="2">INSTALLCOMPONENT3</Publish>
<Publish Dialog="Questions" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="1">1</Publish>
INSTALLCOMPONENT1
安装组件2
安装组件3
1.
我的意思是,颠倒顺序,忘记合成条件。最后,条件的数量是相同的,但它更易于维护和可读。
当然,这意味着会引发多个“NewDialog”事件,但只显示最后一个事件。有人知道不这样做的原因吗?

逻辑更简单,但有点不正确。如果我想安装所有3个组件,则“下一步”按钮在这种情况下不起作用。啊,因此它们不是互斥的。这更有意义;)