This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- Re: How to set IA variables in Execute batch action
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 23, 2010
01:27 AM
How to set IA variables in Execute batch action
Hi everyone,
Does anybody know how to set IA variables in Execute batch action? So I can add dispaly message with rule later.
Thanks!
Does anybody know how to set IA variables in Execute batch action? So I can add dispaly message with rule later.
Thanks!
(8) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 23, 2010
05:17 AM
You simply use IA variables, like $SOME_VARIABLE_NAME$, but don't forget to replace them before executing the batch file!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 23, 2010
10:00 AM
sorry, still don't understand. For example, I add excuting batch action with code
perl -v
if [ $? -eq 0];
then
export $flag$=0(it doesn't work here)
fi
perl -v
if [ $? -eq 0];
then
export $flag$=0(it doesn't work here)
fi
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 23, 2010
10:33 AM
I suspect that your code should be rewritten into:
[CODE]perl -v
if [ $DOLLAR$? -eq 0];
then
export $DOLLAR$flag$DOLLAR$=0(it doesn't work here)
fi[/CODE]
And have the IA variables to be replaced BEFORE the code execution. But on the other hand, what you might not be aware of, is that IA variables are understood only by IA, so even if you execute your Perl script, at the time of the script execution, the IA syntax variable would be meaningless to the script.
[CODE]perl -v
if [ $DOLLAR$? -eq 0];
then
export $DOLLAR$flag$DOLLAR$=0(it doesn't work here)
fi[/CODE]
And have the IA variables to be replaced BEFORE the code execution. But on the other hand, what you might not be aware of, is that IA variables are understood only by IA, so even if you execute your Perl script, at the time of the script execution, the IA syntax variable would be meaningless to the script.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 23, 2010
11:10 AM
I will try it. I don't want to make script understand the IA variable but want ot set variable $falg$ to 0, so I can display message next with rule to check $flag$ is 0 or not.
BTW, could you explain "have the IA variables to be replaced BEFORE the code execution"? I want to set IA variable not get it's value.
BTW, could you explain "have the IA variables to be replaced BEFORE the code execution"? I want to set IA variable not get it's value.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 23, 2010
02:51 PM
Ok, I think this would be like the 2nd time I'm trying to explain to you: it doesn't work like you would expect (i.e. you cannot set an IA variable (one that is surrounded by dollars) in a PERL script, EVEN if you run the script WITHIN IA! It simply doesn't work this way, usually people use IA variables, for variable things, like $USER_INSTALL_DIR$ which are replaced BEFORE running the script. From what the script looks like, you may want to do something a little different: if the thing is zero, set the return value to 0 or something different than 0 in the other case, and if you look closely, you see that the returned exit code is by default stored in the $EXECUTE_EXITCODE$ variable.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 23, 2010
07:45 PM
Hi, sorry, I think maybe I am not clear in the question. Actually I add action to execute batch in installer, and in this action I call a perl script and then check it's return code. I am not going to set IA varialbe in perl but in the batch action. I think this may much easy for you to answer. If the return code is zero, I want to use $flag$ to be 0 and then I can check this variable later. But right now it doesn't work no matter I add "$flag$=0" or "$DOLLAR$flag$DOLLAR$=0" in the execute batch script action.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 27, 2010
08:43 PM
I find the answer finially. The exit code and stdout can be saved as IA variable in the action setting.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 28, 2010
10:01 AM
zhiyangchen wrote:
I find the answer finially. The exit code and stdout can be saved as IA variable in the action setting.
This was precisely what I was trying to explain in my previous post! 🙂