![]() |
|
![]() |
The "Msi" Command |
This command is used to create or open an MSI. You can not use most other commands before this one as the MSI is unavailable for modification! This command can currently only be used once per script.
This command takes these parameters:
You may wish to read template ".IDT" files to populate standard tables.
I prefer not to have my template in binary form but user other methods to obtain the same result. As an example text base ".IDT" files can be revision controlled, examined in Notepad (text editor) and compared using common difference programs. The ".IDT" programs can be imported with the TableImportFromIdt command.
If you are not using the "preferred MSI framework" then it would be a good idea to place to define or create any "complete" feature your MSI might use (use the "Feature" command) as soon as possible after this command.
Programatically Determine the MSI's Name |
This shows how to determine the msi name at build time and assuming you are using the "preferred MSI framework":
#( ;--- Override the default definition in "COMPANY.MMH" --- #define? COMPANY_GET_TEMPLATE_AND_OPEN_MSI <$Msi "<$ProdInfo.MsiName> - <?=FormatTime('%Y-%m-%d @ %H_%M')>.msi" Template="<$COMPANY_MSI_TEMPLATE_FILENAME>"> #)
EXAMPLE - Create a EMPTY Database |
This is an example of how you would create a completely empty database:
<$MSI "..\MSI\fred.msi" Create="Y">
EXAMPLE - Use existing Database as TEMPLATE |
This is an example of how you could use an existing database as a templae:
<$MSI "out\fred.msi" Template="S:\MSI Templates\UISample.msi">
EXAMPLE - Open for Update |
This is an example of how an existing MSI could be opened for update. This may be a template you copied over from elsewhere (however there are easier ways of doing this):
<$MSI "c:\stuff\existing.msi">
EXAMPLE - Open Read Only |
This example simply exports all tables in the database (this is the WHOLE script):
;--- Include the correct support (MAKEMSI.MMH/DEPT.MMH for MSI Creation) ---- #include "OpenMsi.MMH" ;--- Do the work ------------------------------------------------------------ <$Msi "UISAMPLE.msi" ReadOnly="Y"> <$TableExportToIdt> ;;All "normal" tables <$TableExportToIdt TABLE="_SummaryInformation"> ;;Output summary information <$TableExportToIdt TABLE="_ForceCodepage"> ;;Output database code page information <$/Msi>
With little more work the filename could be passed from a batch file to make it a command line MSI table dumper (and binary extractor).
![]() ![]() |
| ![]() ![]() |