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

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:

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).


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]: MergeModule[Next]: /Msi


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Saturday May 28 2022 at 3:11pm
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.