Archive: Detect if run-time variable is defined


Detect if run-time variable is defined
Hi all,

i have tried finding information but to no avail :)

I have written a macro that will dump some debug information into a file and i am sharing this macro between multiple installers.

For instance it will dump the installed IIS version, but some installers will not have that script included that creates and fills the variables (e.g Var /Global IISMajorVersion).

Is there a way to "exclude" these variables from processing automatically? With Symbols i could do a !ifndef.... so i do not get:

warning: unknown variable/constant "IISMajorVersion
" detected, ignoring (macro:_DebugInformation:10)

Thanks a lot and if this was maybe explained somewhere else i would appreciate if you could point me to the right place.

x


Why don't you just declare the variable inside the macro that needs it?


Originally posted by MSG
Why don't you just declare the variable inside the macro that needs it?
It is declard in the macro that detects the IIS Version, and is dumped in another macro. If i declare it a second time i get an error.

Create a define when you create the variable, then check if that define is set. The NSIS macro headers do this so that they can be !included multiple times. MUI2 does this with its own nsDialogs variables.

Stu


:up: Thanks Stu