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

conditional execution

Hi
I need to ask the user if they wish to proceed if an environment variable is not set.

The installer should check if the environment variable exists (silently) and if it does not, a dialog window should present a message asking the user if they want to continue.

I know it sounds simple but I have had great difficulty doing this. Any help would be much appreciated.

Best Regards,
Kevin
Labels (1)
0 Kudos
(2) Replies
enanrum
Level 9

I'm sure there is a few ways, but what I've done is create a new dialog with the message you wish to present, create it in the appropriate frame: like Cancel.

I take it you know how to check for the ENV Var, so in your Events view, check for the existence of the var in onBegin event.

so you do something like:

String envVar = arg0.resolveString("$E(ENV_VAR)");

if (envVar.equalsIgnoreCase("null")){
// ceate a flag variable to show the dialog
arg0.getServices().getISDatabase().setVariableValue("SHOWDIALOG","true");
}else{
// verify variable is what you expect
~
~
arg0.getServices().getISDatabase().setVariableValue("SHOWDIALOG","false");
}


Then - put your dialog in the sequence and set a stringComparison condition;
Compare Text = $V(SHOWDIALOG)
Source = true

EDIT: That is set the Condition property of the Dialog to show using the stringComparison condition.

Regards,
Tom
0 Kudos
Kobbler
Level 3

Hey Tom. Thanks for the reply.

I think I understand what you are telling me but I am unsure where I am to put the string comparison.

This is what I think you are saying. In the event view I check if the environmental variable is present. I then set a value in the IS database to true or false. I then test the value in the database to determine if the dialog will be shown or not. I am unsure where to call the string comparison condition.

Thanks again,
Kevin

EDIT:

Nevermind. I understand now. Thanks.
0 Kudos