Compiler variables.

Got a problem you cannot solve? Try here.
Post Reply
bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Compiler variables.

Post by bokkie »

Attached code snippet shows some code that's puzzling me:

[compiler if Variable MYCOMPILERVARIABLE is Defined ]
MessageBox: My compiler variable..., ...is defined.
[compiler end]


I've defined a compiler variable in the Project Options. If I set a breakpoint on the [compiler if...] statement it seems to step on to the MessageBox but it displays nothing.

If, however, I change the code to:

[compiler if Variable MYCOMPILERVARIABLE Equals 1234567890]
MessageBox: My compiler variable..., #MYCOMPILERVARIABLE#
[compiler end]


It steps on to the MessageBox and it displays the value correctly.

My question is this: Should the "is defined" work if the compiler variable is defined (which it is) regardless if it has a value or not? Or am I misunderstanding what "is defined" means? :?
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
StyX
Posts: 51
Joined: Fri Apr 11, 2008 7:14 am
Location: Stavanger, Norway
Contact:

Re: Compiler variables.

Post by StyX »

EDIT: Ignore this.... All wrong :oops:
bokkie wrote: [compiler if Variable MYCOMPILERVARIABLE is Defined ]
MessageBox: My compiler variable..., ...is defined.
[compiler end]
The IF check is not if that varible has been define, rather that the value of MYCOMPILERVARIABLE == Defined
Last edited by StyX on Fri Feb 13, 2009 10:31 am, edited 1 time in total.
bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: Compiler variables.

Post by bokkie »

StyX wrote:
bokkie wrote: [compiler if Variable MYCOMPILERVARIABLE is Defined ]
MessageBox: My compiler variable..., ...is defined.
[compiler end]
The IF check is not if that varible has been define, rather that the value of MYCOMPILERVARIABLE == Defined
Styx,

So equals 1234567890 is the same as is 1234567890?
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
StyX
Posts: 51
Joined: Fri Apr 11, 2008 7:14 am
Location: Stavanger, Norway
Contact:

Post by StyX »

Scratch that, I got ahead of myself. Didn't notice the IS in there.
bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Post by bokkie »

StyX wrote:Scratch that, I got ahead of myself. Didn't notice the IS in there.
You're not getting out of it so easily... :)
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
StyX
Posts: 51
Joined: Fri Apr 11, 2008 7:14 am
Location: Stavanger, Norway
Contact:

Post by StyX »

Did a little bit of testing and to me it seems that the is defined check doesn't work at all.

Tried with just adding the variable without any value, with a value and not having a added it at all. And in all cases it doesn't seem to me like the code inside it is actually executed :-S
bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Post by bokkie »

StyX wrote:Did a little bit of testing and to me it seems that the is defined check doesn't work at all.

Tried with just adding the variable without any value, with a value and not having a added it at all. And in all cases it doesn't seem to me like the code inside it is actually executed :-S
That was my observation as well. Time for Michael to step in and put us both out of our misery. :)
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

I have confirmed with R&D that the last two options in the drop down on the Compiler Variable If dialog are currently not available for compiler variables. Sorry about this bug...

These do work well in the If dialog of course.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Post by bokkie »

I will probably not use compiler variables that often but it's nice to see that you control them from one project options dialog.

I hate it when things can only join up unless you scatter the options in multiple hard to get at places which has been my experience with another product. :wink:
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
Post Reply