I have a situation where I need to know which features are to be installed/uninstalled in change mode, accordingly I'll be able to modify dialog sequence.
My setup includes 2 features F_WEB_APP and F_DATABASE, to make my life easier, I published the following properties on customize dialog next button to identify which features are installed, to be installed or to be uninstalled based on feature conditions as follows:
<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>
During first install, all of my properties are being set according to user selection (expected behavior), but during change/modify they are set only once (on customize dialog first load - values match existing state, regardless of user changes)! and if user makes changes and press next or proceed then go back and change selected features and click next, none of the properties gets set ... whats wrong here ??
The log for first install (trimmed for readability):
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
The log for change/modify (trimmed for readability):
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
As you can see from the second log NO PROPERTY CHANGE RECORDED, What is it that I'am missing here?
Thanks.
After hours and hours of reading, I came up empty handed!! I couldn't find any solution to this any where.
The good news is I figured out a solution on my own (not ideal) but it works!!!!
Every feature has several components linked to it, but I have at least one non-conditional component that is always there with the feature ( for example registry component), after giving up on getting feature request/action state to be updated, I tried component request/action state .. and yes it is updated.
So I based my conditions on component request/action state instead of feature request/action state as follows:
<!--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>
Note:In case the user made no changes to selection tree, feature components action/request states will be unknown = -1.
Now I can use the above properties to sequence dialogs in change/modify mode:
<!--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>