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]: Column[Next]: Compile
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Source Code->Commands->Column->Column Macros

Column Macros

The "Column" command creates some standard definitions which record some useful information about the tables and columns being defined to make reference to the column easier if you are writing custom VBSCRIPT code, these are:

  1. MACRO: COL#.TableName.ColumnName
    This will expand to an integer representing the columns location within a record (1, 2, ...).

  2. MACRO: COLSTR.TableName.ColumnName
    This will expand to a VBSCRIPT expression which refers to the columns data within a record as a string ("oRec.StringData(2)" etc). The record name can be passed as positional parameter 1 if required but the default of "oRec" is probably what you want.

  3. MACRO: COLINT.TableName.ColumnName
    This will expand to a VBSCRIPT expression which refers to the columns data within a record as an integer ("oRec.IntegerData(2)" etc). The record name can be passed as positional parameter 1 if required but the default of "oRec" is probably what you want.

EXAMPLE

In the following example we wish to avoid hardcoding column numbers or refering to specific VBSCRIPT variables:

<$Table "Dialog">
    dim DialogNameTitle
    <$Row @Where="" @OK=^? > 0^ @Code="Y" *Title="DialogNameTitle">
          ;--- Debug stuff --------------------------------------------------
          say ""
          say "DialogName = " & <$COLSTR.Dialog.Dialog>
          say "Width      = " & <$COLINT.Dialog.Width>

          ;--- Set up the new title in the VB variable mentioned above ------
          DialogNameTitle = "[\[]" & <$COLSTR.Dialog.Dialog> & "[\]] - " & <$COLSTR.Dialog.Title>
    <$/Row>
<$/Table>

This example shows how you can see if a particular column has been defined or not and vary processing if required:

#ifndef COL#.CustomAction.Action
        #error ^This should be defined :-), Don't know why we got here!^
#endif
#ifndef COL#.CustomAction.ExtendedType
        #error ^We need the "ExtendedType" column of Windows Installer 4.5+.^
#endif


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]: Column[Next]: Compile


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Friday October 13 2017 at 2:08pm
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.