MAKEMSI quickly and reliably creates MSI files in a non-programmatic way
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
[Bottom][Contents][Prev]: The 'CRLF' Macro[Next]: AbortIf
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Source Code->Commands->Useful Macros->The 'VbExp' Macro

The '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>


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: The 'CRLF' Macro[Next]: AbortIf


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Sunday February 28 2016 at 3:45pm
Visit MAKEMSI's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.