cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
klim_c
Level 3

Prevent user from unselecting features

Hi there!
I would appreciate it very much if some one helps me with this issue.
This is InstallScript project.

There is a "Feature 1" which has 2 subfeatures: "Feature 1a" and "Feature 1b".
I want to prevent user from unselectiong both "Feature 1a" and "Feature 1b" at the same time. Either one can be unselected, but not both.
If both unselected, and user pressed Next button, message box pops up, warning the user.

Please see attachments 1 and 2.

Thanks
Labels (1)
0 Kudos
(4) Replies
Holger_G
Level 10

My suggestion:
[SIZE="1"]
if (!FeatureIsItemSelected(MEDIA, "Feature1\\Feature1a") && !FeatureIsItemSelected(MEDIA, "Feature1\\Feature1b")) then
SprintfBox( INFORMATION, "%s", "Warning text" );

goto Dlg_SdFeatureTree;

endif;
[/SIZE]

Place it in OnFirstUIBefore() & OnMaintUIBefore().
0 Kudos
klim_c
Level 3

Holger_G wrote:
My suggestion:
[SIZE="1"]
if (!FeatureIsItemSelected(MEDIA, "Feature1\\Feature1a") && !FeatureIsItemSelected(MEDIA, "Feature1\\Feature1b")) then
SprintfBox( INFORMATION, "%s", "Warning text" );

goto Dlg_SdFeatureTree;

endif;
[/SIZE]

Place it in OnFirstUIBefore() & OnMaintUIBefore().


Thank you Holger for your help.
I added it to OnFirstUIBefore() and it works when installing.
But where can I find that OnMaintUIBefore() method? It's not in my Setup.rul. How to add it? Or, where to place the code, so it could be called during uninstalling the features?
Thanks
0 Kudos
rrinblue22
Level 9

Hey you can add OnMaintUIBefore from the InstallScript view.
at the extreme right hand in this view you'll have two drop down.........
you'll find it there.

"Feature_uninstalling" would work when a feature is selected for uninstall.
0 Kudos
klim_c
Level 3

rrinblue22 wrote:
Hey you can add OnMaintUIBefore from the InstallScript view.
at the extreme right hand in this view you'll have two drop down.........
you'll find it there.

"Feature_uninstalling" would work when a feature is selected for uninstall.


Thanks a lot 🙂
0 Kudos