Page 1 of 1

Compiler Variables: problems with use of

Posted: Thu Mar 05, 2009 7:10 pm
by CBelanger
Hello:

Newbie to InstallAware. Very much like the idea of compiler variables for setting up several install scenarios which are very similar: a Professional, Vendor and Update.

I added the following Compile Variables: DO_PROF = TRUE, DO_VEND = FALSE, DO_PROFUP = FALSE, DO_VENDUP = FALSE to the project settings tree.

But when I am running in debug mode I note that no matter the setting, any Conditional IF DO_PROF equals TRUE clause is processed just the same as Conditional IF DO_VEND equals TRUE clause. (even though DO_VEND = FALSE)

My test clause is SET Variable TITLE equals NMT Treeview Professional and
for the DO_VEND, SET Variable TITLE equals NMT Treeview Vendor.

Both are processed, thus the title ends up being "NMT Treeview Vendor." because it is the last line.

In the Watch variables area if I watch the DO_VEND and DO_PROF, they are "undefined" unless I specifically SET VARIABLE TO for each in the script. I would think that they are defined in the project settings area?

My next step is to use the Conditional variables for modifying the install files, but I'm getting the feeling that I'm missing something very basic here.

I'd appreciate some help.

Thanks

Chuck Belanger

Posted: Thu Mar 05, 2009 7:56 pm
by MichaelNesmith
You're using a test for normal variables on compiler variables. If you need runtime branching, declare these as normal variables in-code using Set Variable. If you need compile time build customization, use Compiler Variable If instead.

You may not even need to use compiler variables with runtime branching, but it might still make sense to do so if you need to ship out physically differentiated builds.

Posted: Fri Mar 06, 2009 8:31 pm
by CBelanger
Thanks, Michael:

I tried right after your post and everything started working correctly.

But, at first I was not sure about your comment. But did gradually see that if I was trying to exclude FILE INSTALL during a compile then the compile variables were perfect, and for other logic branching that it was better to simply create a variable for the script using SET VARIABLE to the compiler var setting and then use that variable in my code.

I did learn one thing:
InstallAware does not respond to the following

IF COMPILE VAR is FALSE
IF COMPILE VAR2 is FALSE
do something
END
END

Thanks,

Chuck

Posted: Fri Mar 06, 2009 9:37 pm
by MichaelNesmith
???

Posted: Sat Mar 07, 2009 6:56 am
by bokkie
CBelanger wrote:...InstallAware does not respond to the following

IF COMPILE VAR is FALSE
IF COMPILE VAR2 is FALSE
do something
END
END
Chuck, I presume you mean something like this that does work:

[compiler if Variable A Equals FALSE]
[compiler if Variable B Equals FALSE]
MessageBox: AB, Both are FALSE
[compiler end]
[compiler end]


or this which also works:

Set Variable A to FALSE
Set Variable B to FALSE
if Variable A Equals FALSE
if Variable B Equals FALSE
MessageBox: AB, Both are really FALSE
end
end


EDIT: Don't confuse my use of the two variables A and B. You can't reference compiler variables in normal if statements. Remove the two Set Variable statements and you'll see what I mean.

Posted: Sat Mar 07, 2009 6:10 pm
by CBelanger
Hello:

Yes, I learned that for normal script statements I had to:

Set Variable A to Compile Var A

and that worked for normal script evaluation of var A from then on.

But, It seems that InstallAware was not evaluating neither Compiler Var A or B correctly when they were serial logic statements. It seems that for Compile Var evaluation there can be only one.

I have since rewritten all my logic using such var instances and everything works properly, so I must have it correct now.

But you are saying that the two sequential Compile Variable evaluations do work as expected. I did not see that. What I saw was that if I had a series of these, they all seemed to evaluated to TRUE, so whatever the last setting was was what was the final setting, or ALL action statements occurred (e.g. all files installed not just different groups of them as I intended.)
Chuck

[compiler if Variable A Equals FALSE]
[compiler if Variable B Equals FALSE]
MessageBox: AB, Both are FALSE
[compiler end]
[compiler end][/b]

bokkie wrote:
CBelanger wrote:...InstallAware does not respond to the following

IF COMPILE VAR is FALSE
IF COMPILE VAR2 is FALSE
do something
END
END
Chuck, I presume you mean something like this that does work:

[compiler if Variable A Equals FALSE]
[compiler if Variable B Equals FALSE]
MessageBox: AB, Both are FALSE
[compiler end]
[compiler end]


or this which also works:

Set Variable A to FALSE
Set Variable B to FALSE
if Variable A Equals FALSE
if Variable B Equals FALSE
MessageBox: AB, Both are really FALSE
end
end


EDIT: Don't confuse my use of the two variables A and B. You can't reference compiler variables in normal if statements. Remove the two Set Variable statements and you'll see what I mean.