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

The "TableDefinition" Command

Before MAKEMSI can refer to a table it needs to know some information about it. This applies to standard MSI tables or any that you might wish to create for your own uses.

This command begins the definition for a table which ends when the /TableDefinition command is encountered. Between these commands you would place a Column command for each column of the table you are defining.

If there is more than one definition for any particular table all but the first is ignored.

Note that you may wish to also populate the "_Validation" table for any custom table you define or you will get validation error messages although you could filter these out. I suggest that you do update the validation table to apply as tight a checking as possible so as to catch as many errors as you can in the build step.

If you already have a database which contains the table(s) (such as the SDK supplied "schema.msi" file) then the easiest way to generate the correct table definitions is to use the "export to .IDT" facility. If you already have ".idt" files then the "IDT Conversion" option is another possibility.

This command takes these parameters:

EXAMPLE

This example shows the definitions for the standard MSI "Binary" and "File" tables:

<$TableDefinition "Binary">
   <$Column "Name"  TYPE="s72"  KEY="Y">  ;;Max 72 Characters
   <$Column "Data"  TYPE="v0">            ;;Binary field (unlimited length)
<$/TableDefinition>
<$TableDefinition "File">
   <$Column "File"        TYPE="s72"   KEY="Y">
   <$Column "Component_"  TYPE="s72">
   <$Column "FileName"    TYPE="l255">
   <$Column "FileSize"    TYPE="i4">
   <$Column "Version"     TYPE="S72">
   <$Column "Language"    TYPE="S20">
   <$Column "Attributes"  TYPE="I2">
   <$Column "Sequence"    TYPE="i2">
<$/TableDefinition>

;--- Define an internal MAKEMSI table ---------------------------------------
<$TableDefinition "MAKEMSI_FileSource">
   <$Column "File_"       TYPE="s72"   KEY="Y">
   <$Column "SourceFile"  TYPE="s255">
<$/TableDefinition>
<$TableCreate "MAKEMSI_FileSource">
<$Table "_Validation">
#(
   <$Row
            Table="MAKEMSI_FileSource"
           Column="File_"
         Nullable="N"
         KeyTable="File"
        KeyColumn="1"
         Category="Identifier"
      Description="Foreign key into the File table."
   >
#)
#(
   <$Row
            Table="MAKEMSI_FileSource"
           Column="SourceFile"
         Nullable="N"
         Category="Text"
      Description="Full name of source file."
   >
#)
<$/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]: TableCreate[Next]: /TableDefinition


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