我有一种情况需要知道在更改模式中安装/卸载哪些功能,因此我将能够修改对话框顺序。
我的设置包括2个功能 F_WEB_APP 和 F_DATABASE ,让我的生活更轻松,我在自定义对话框的下一个按钮上发布了以下属性,以确定安装了哪些功能,根据功能条件安装或卸载,如下所示:
<Publish Dialog="CustomizeDlg" Control="Next" Property="IsDBInstalled" Value="Yes" Order="5"><![CDATA[!F_DATABASE > 2]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Property="IsDBInstalled" Value="No" Order="6"><![CDATA[!F_DATABASE < 3]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Property="IsWebInstalled" Value="Yes" Order="7"><![CDATA[!F_WEB_APP > 2]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Property="IsWebInstalled" Value="No" Order="8"><![CDATA[!F_WEB_APP < 3]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Property="IsDBSelected" Value="Yes" Order="9"><![CDATA[&F_DATABASE > 2]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Property="IsDBSelected" Value="No" Order="10"><![CDATA[&F_DATABASE < 3]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Property="IsWebSelected" Value="Yes" Order="11"><![CDATA[&F_WEB_APP > 2]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Property="IsWebSelected" Value="No" Order="12"><![CDATA[&F_WEB_APP < 3]]></Publish>
在首次安装期间,我的所有属性都是根据用户选择(预期行为)设置的,但在更改/修改期间,它们仅设置为一次(在自定义对话框上首次加载 - 值与现有状态匹配,无论用户如何变化)!如果用户进行更改并按下一步或继续,然后返回并更改所选功能,然后单击下一步,没有任何属性设置...这里有什么问题?
首次安装的日志(为便于阅读而修剪):
Action 20:34:08: CustomizeDlg. Dialog created
* user modify features and press next.
MSI (c) (94:90) [20:34:09:374]: PROPERTY CHANGE: Adding IsDBInstalled property. Its value is 'No'.
MSI (c) (94:90) [20:34:09:376]: PROPERTY CHANGE: Adding IsWebInstalled property. Its value is 'No'.
MSI (c) (94:90) [20:34:09:378]: PROPERTY CHANGE: Adding IsDBSelected property. Its value is 'Yes'.
MSI (c) (94:90) [20:34:09:379]: PROPERTY CHANGE: Adding IsWebSelected property. Its value is 'Yes'.
Action 20:34:09: NextDlg. Dialog created
* user press back.
Action 20:34:09: CustomizeDlg. Dialog created
* user modify features and press next.
MSI (c) (94:90) [20:34:12:376]: PROPERTY CHANGE: Modifying IsWebSelected property. Its current value is 'Yes'. Its new value: 'No'.
Action 20:34:12: NextDlg. Dialog created
* user press back.
Action 20:34:13: CustomizeDlg. Dialog created
* user modify features and press next.
MSI (c) (94:90) [20:34:15:129]: PROPERTY CHANGE: Modifying IsDBSelected property. Its current value is 'Yes'. Its new value: 'No'.
Action 20:34:15: NextDlg. Dialog created
* user press back.
Action 20:34:15: CustomizeDlg. Dialog created
* user modify features and press next.
MSI (c) (94:90) [20:34:18:289]: PROPERTY CHANGE: Modifying IsWebSelected property. Its current value is 'No'. Its new value: 'Yes'.
Action 20:34:18: NextDlg. Dialog created
更改/修改的日志(为了便于阅读而修剪):
Action 21:01:41: CustomizeDlg. Dialog created
* user modify features and press next.
MSI (c) (6C:1C) [21:01:45:216]: PROPERTY CHANGE: Adding IsDBInstalled property. Its value is 'Yes'.
MSI (c) (6C:1C) [21:01:45:220]: PROPERTY CHANGE: Adding IsWebInstalled property. Its value is 'Yes'.
MSI (c) (6C:1C) [21:01:45:223]: PROPERTY CHANGE: Adding IsDBSelected property. Its value is 'No'.
MSI (c) (6C:1C) [21:01:45:225]: PROPERTY CHANGE: Adding IsWebSelected property. Its value is 'No'.
Action 21:01:45: NextDlg. Dialog created
* user press back.
Action 21:01:45: CustomizeDlg. Dialog created
* user modify features and press next.
Action 21:01:48: NextDlg. Dialog created
* user press back.
Action 21:01:49: CustomizeDlg. Dialog created
* user modify features and press next.
Action 21:01:51: NextDlg. Dialog created
* user press back.
Action 21:01:52: CustomizeDlg. Dialog created
* user modify features and press next.
Action 21:01:54: NextDlg. Dialog created
从第二个日志中可以看到没有记录属性更改,我在这里缺少什么?
感谢。
答案 0 :(得分:0)
经过几个小时的阅读,我空手而归!我找不到任何解决方案。
好消息是我自己想出了一个解决方案(不理想),但它有效!!!!
每个功能都有几个链接到它的组件,但在放弃获取要更新的功能请求/操作状态之后,我至少有一个非条件组件始终存在该功能(例如注册表组件),我尝试了组件请求/操作状态..是的,它已更新。
所以我的条件基于组件请求/操作状态而不是功能请求/操作状态,如下所示:
<!--If one of Database feature required components request state is Local or Source or Default. it means install.-->
<Publish Dialog="CustomizeDlg" Control="Next" Property="InstallDatabase" Value="1" Order="5"><![CDATA[$CMP_DATABASE_REGISTRY > 2]]></Publish>
<!--else clear the propery.-->
<Publish Dialog="CustomizeDlg" Control="Next" Property="InstallDatabase" Order="6"><![CDATA[$CMP_DATABASE_REGISTRY < 3]]></Publish>
<!--If one of Database feature required components request state is Absent. it means uninstall.-->
<Publish Dialog="CustomizeDlg" Control="Next" Property="UninstallDatabase" Value="1" Order="7"><![CDATA[$CMP_DATABASE_REGISTRY = 2]]></Publish>
<!--else clear the property .-->
<Publish Dialog="CustomizeDlg" Control="Next" Property="UninstallDatabase" Order="8"><![CDATA[$CMP_DATABASE_REGISTRY <> 2]]></Publish>
<!--If one of WebApp feature required components request state is Local or Source or Default. it means install.-->
<Publish Dialog="CustomizeDlg" Control="Next" Property="InstallWebApp" Value="1" Order="9"><![CDATA[$CMP_WEB_APP_REGISTRY > 2]]></Publish>
<!--else clear the propery.-->
<Publish Dialog="CustomizeDlg" Control="Next" Property="InstallWebApp" Order="10"><![CDATA[$CMP_WEB_APP_REGISTRY < 3]]></Publish>
<!--If one of WebApp feature required components request state is Absent. it means uninstall.-->
<Publish Dialog="CustomizeDlg" Control="Next" Property="UninstallWebApp" Value="1" Order="11"><![CDATA[$CMP_WEB_APP_REGISTRY = 2]]></Publish>
<!--else clear the property .-->
<Publish Dialog="CustomizeDlg" Control="Next" Property="UninstallWebApp" Order="12"><![CDATA[$CMP_WEB_APP_REGISTRY <> 2]]></Publish>
注意:如果用户未对选择树进行任何更改,则功能组件操作/请求状态将为未知= -1。
现在,我可以使用上述属性对更改/修改模式中的对话框进行排序:
<!--collect WebApp setting if WebApp to be installed, WebAppDlg will handle where to go next.-->
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="WebAppDlg" Order="13"><![CDATA[Installed AND InstallWebApp]]></Publish>
<!--collect Database setting if WebApp not to be installed and Database to be installed or uninstalled, DatabaseDlg will handle where to go next.-->
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="DatabaseDlg" Order="14"><![CDATA[Installed AND NOT InstallWebApp AND (InstallDatabase OR UninstallDatabase)]]></Publish>
<!--user made no changes go to verify ready dialog.-->
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="15"><![CDATA[Installed AND NOT InstallWebApp AND NOT InstallDatabase]]></Publish>