PDA

View Full Version : How to figure out if a feature is selected in SelectionTree control



miltonc
06-16-2005, 09:39 AM
I discover the features to be installed only during runtime. I tried using Checkboxes to display features to the user, but I ran into the problem of not having enough space. Check my previous post about Multiple Checkboxes in a single dialog.
http://community.installshield.com/showthread.php?t=148995

Anyways, I want to try and use a SelectionTree control since it has a scroll bar. Sometime (After SetupInitialization) during the UI sequence, I insert the following into the Feature table.
oQuery = "INSERT INTO `Feature` (`Feature`, `Title`, `Display`, `Level`, `Directory_`, `Attributes`) VALUES ( 'Feature" & i & "', '" & FeatureName & "', " & Cstr(i + 4 * i) & ", " & CStr(1) & ", '" & Target & "', " & CStr(0) & ") TEMPORARY"
So, now I get this dialog to be displayed to the user. See attachment.

I want to do a custom action when the user selects a certain feature to be installed from the SelectionTree control. I can do it either when the user clicks on the Next button or when the user selects the feature. Basically, I want to capture what features the user wants. (preferably an index of the feature displayed). I am not sure how to figure out what feature was selected by the user. Any help in this matter would be very helpful.

chris_p
06-20-2005, 03:38 AM
If you want to lauch a custom action based on the selection of a feature, you can add a condition. MSDN Winsode installer Conditions (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/conditional_statement_syntax.asp)
If you want to know if a feature is selected in a custom action, you can use the Method FeatureRequestState of the Session object: MSDN Windows Installer Session Object (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/session_featurerequeststate.asp)

miltonc
06-20-2005, 09:35 AM
Thanks. I kind of figured it out. But this is great. I did run into another problem. I guess I will create a new post for that.

mraghunath
08-26-2010, 07:02 AM
miltonc can you please explain how you could do the same