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 [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 for the Windows SDK (Windows Installer) area.This external link was OK when tested at 7 Aug 2008Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: The [Next]: AbortIf


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Tuesday August 19 2008 at 7:04pm
Visit MAKEMSI's Home PageThis external link was OK when tested at 13 Aug 2008

HTML page dated Mon, 29 Jan 2007 00:11:11 GMT
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006 & 2007 for the Windows SDK (Windows Installer) area.This external link was OK when tested at 7 Aug 2008