\Source CodeCommandsUseful MacrosThe 'VbExp' Macro
Some commands such as "row" and
"property" allow you to pass one or more
of its parameters as VBSCRIPT expressions instead of literal
strings, however not all do.
For commands which only take a literal value this macro can
generally be used to imbed the result of an
expression (evaluated at INSTALLATION time).
The expression should be passed in the "EXP" parameter.
This macro may not work in all cases, for example if MAKEMSI
has to process the value before creating the Windows Installer
entries.
EXAMPLE #1 - Simple Expression on Registry Command |
dim SomeVar : SomeVar = Fred(true)
<$Registry HKEY="CURRENT_USER" Key="Software\DENNIS" Name='STRING1' Value="<$VbExp EXP=^lcase(SomeVar)^>">
EXAMPLE #2 - Imbedding a TAB stop Into a Registry Value |
#define vbTAB <$VbExp EXP=^vbTAB^>
...
<$Registry HKEY="CURRENT_USER" Key="Software\DENNIS" Name='ContainsTab' Value="1234<$vbTAB>5678">
EXAMPLE #3 - Dynamic @WHERE clause on Row Command |
<$Table "Property">
dim IgnoreProperty : IgnoreProperty = "ButtonText_Ignore"
#(
<$Row
@Where="`Property` = '<$VbExp EXP=%IgnoreProperty%>'"
@OK='=1'
Value="&IgnoreXX"
>
#)
<$/Table>