cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
clairealex
Level 2

Disable/enable ChangeFolder button on CustomSetup dialog based on Feature selected.

I am trying to enable/disable the ChangeFolder button on CustomSetup dialog, based on the feature which is selected in the tree, since some features HAVE to be in INSTALLDIR, whereas others can go to a different location.
In the msi log, I can see that MsiSelectionTreeSelectedFeature is set to the currently selected feature is the tree.
MSI (c) (0C:28) [14:54:46:881]: PROPERTY CHANGE: Modifying _IsSetupTypeMin property. Its current value is 'Typical'. Its new value: 'Custom'.
MSI (c) (0C:28) [14:54:47:881]: PROPERTY CHANGE: Adding MsiSelectionTreeSelectedFeature property. Its value is 'NewFeature1'.
MSI (c) (0C:28) [14:54:47:881]: PROPERTY CHANGE: Adding MsiSelectionTreeSelectedAction property. Its value is '3'.
MSI (c) (0C:28) [14:54:47:881]: PROPERTY CHANGE: Adding MsiSelectionTreeSelectedCost property. Its value is '32'.
MSI (c) (0C:28) [14:54:47:881]: PROPERTY CHANGE: Adding MsiSelectionTreeSelectedPath property. Its value is 'C:\Program Files (x86)\My Company Name\My Product Name\First\'.
But If I define a condition for the ChangeFolder button depending on the value of MsiSelectionTreeSelectedFeature property, it has no effect.
I read that on https://community.flexerasoftware.com/showthread.php?204196-Use-MsiSelectionTreeSelectedFeature-in-CustomSetup-dialog: "I found out the solution: we must use the SetProperty event on the Tree to set a property.".
I tried doing that, but it did not help.

Does anyone know how to handle this?

Thank you
Labels (1)
0 Kudos
(1) Reply
DLee65
Level 13

You should be able to set conditions without setting a property using the feature syntax for determining the feature state. See the conditional statement syntax. For example &MyFeature=3 evaluates to True only if 'MyFeatrure' is changing from its current state to the state of being installed on the local computer.
I have a vague recollection that this is related to redrawing the dialog to reevaluate the condition on the push button. For instance, when you click something in the tree object, it does not necessarily tell it to reevalute all controls on the current dialog. It only redraws the tree object.
One solution to consider is clone a secondary dialog and when a user clicks on the feature tree set an event to load the other dialog while unloading the other dialog. Again, I have a vague recollection of having to do this many many years ago.

Hopefully this helps.
0 Kudos