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

Uninstaller: Detect Feature Selections...HELP?!?!?!

Hello to all,

I would like to know how we can detect the selected (checked/unchecked) Feature from the Uninstall Feature Panel? During the "Install", making use of "isActive()" for the feature/bean works great and will properly tell me if the Feature is selected or not selected (checked/unchecked). However, during the Uninstall, this ALWAYS returns true regardless of the Feature's state of being selected for removal. WHY?????? I have also tried using "isActiveForUninstall()" against the installed Software object. But, this always returns FALSE regardless of the feature selected for removal. WHY???? One would think there was a simple IS API to call and retrieve the checked state of the dynamically built Feature tree - but there is nothing I can find. Any ideas would be greatly appreciated.

Thanks!
Labels (1)
0 Kudos

(5) Replies
enanrum
Level 9

I have not tried this on uninstall but I use it on my features dialog!

Instead of using isActive() try using something like:

String checked = arg0.resolveString("$P(FeatureBeanID.active)")

This will return a true or false string!

You can do something like:

if (arg0.resolveString("$P(FeatureBeanID.active)").equalseIgnoreCase("true") ){
its checked!
}

You can also use this for a Condition to any Custom Action or Dialog in the sequences with a StringComparison with $P(FeatureBeanID.active) = true

Regards,
Tom
0 Kudos
krbprogrammer
Level 3

enanrum wrote:
I have not tried this on uninstall but I use it on my features dialog!

Instead of using isActive() try using something like:

String checked = arg0.resolveString("$P(FeatureBeanID.active)")

This will return a true or false string!

You can do something like:

if (arg0.resolveString("$P(FeatureBeanID.active)").equalseIgnoreCase("true") ){
its checked!
}

You can also use this for a Condition to any Custom Action or Dialog in the sequences with a StringComparison with $P(FeatureBeanID.active) = true

Regards,
Tom


Thanks for the reply, but again - these do not work during Uninstall. It is as if NONE of the .active, .isActive(), or isActiveForUninstall() - work or apply to the Uninstall phase. 😞
0 Kudos
enanrum
Level 9

D'oh!

Yah the uninstaller is funny - They must do something different here because they even show features or sub-features that were not visible on install in the uninstaller feature dialog!!!!

Ugly!

Sorry I couldn't help!
0 Kudos
pgarvey
Level 4

Did you ever find a solution to this? I'm having the same problem - I can easily check if a feature has been selected for install, but the same procedure does not work for Uninstall.

Anybody have any ideas?

Thanks,
Paul
0 Kudos
pgarvey
Level 4

I finally got it to work - if anybody else is having the same problem, this is the solution I found.

Within the UninstallFeature dialog, I was trying to check if a feature was selected by doing the following:

String F1act = context.getServices().resolveString("$P(App1.active)");

This method works fine for installing, but NOT uninstalling. You need to use:

String F1act = context.getServices().resolveString("$P(App1.activeForUninstall)");

So, for an uninstall window with two features listed, I was able to make sure that at least one was selected before proceeding by doing the following:

public void queryExitUninstallFeature(com.installshield.event.ui.ISDialogQueryContext context)
{
String F1act = context.getServices().resolveString("$P(App1.activeForUninstall)");
String F2act = context.getServices().resolveString("$P(App2.activeForUninstall)");
if (F1act.equals("false") && F2act.equals("false"))
{
context.getWizardUI().displayUserMessage(
context.getServices().resolveString(
context.getISFrame().getTitle()),
context.getServices().resolveString(
"Please select at least one feature before Proceeding!"),
UserInputRequest.MESSAGE);
//context.logEvent(this, Log.ERROR, "Feature Test");
context.setReturnValue(false);
}
}

Thanks,
Paul
0 Kudos