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]: Sample MsiDiff Output - comcat.msm (merge module)[Next]: UpgradeCode, Simple Tool to dump MSI codes
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Tips and Tricks->Tools->MSIDIFF.VBS->How to Post Process MSIDIFF Output

How to Post Process MSIDIFF Output

The generation of the MAKEMSI documentation uses "SeqTable.DH" and creates some ".html" files (from MSIDIFF.VBS output) containing the sequencing information of "uisample.msi". This output looks like:

ActionSequence
Number
FatalError-3
UserExit-2
ExitDialog-1
LaunchConditions100
PrepareDlg140
FindRelatedProducts200
AppSearch400
CCPSearch500
RMCCPSearch600
CostInitialize800
FileCost900
CostFinalize1000
MigrateFeatureStates1200
WelcomeDlg1230
ResumeDlg1240
MaintenanceWelcomeDlg1250
ProgressDlg1280
ExecuteAction1300

The "MSIDIFF.VBS" output contains "table", "row" and other macros to describe the table data. It is a simple matter to define what each of these macros does when generating HTML and the "#include" this output.

The contents of "SeqTable.DH" code is:

;----------------------------------------------------------------------------
;     MODULE NAME:   SEQTABLE.DH
;
;         $Author:   USER "Dennis"  $
;       $Revision:   1.4  $
;           $Date:   31 Jul 2007 17:49:22  $
;        $Logfile:   C:/DBAREIS/Projects.PVCS/Win32/MakeMsi/SeqTable.DH.pvcs  $
;
;     DESCRIPTION
;     ~~~~~~~~~~~
;     The "MsiSeqTable" macro below calls "MSIDIFF.VBS" to dump a
;     "UISAMPLE.MSI" <$sequence "sequence table"> into a html file.
;
;     I generate an intermediate html file for performance, this way I only
;     have to generate the output once and include in as many places as I wish
;     to use it (the #include is much quicker).
;
;     This is used in the generation of the MAKEMSI documentation, it uses
;     the table like:
;
;           <$Title Text="InstallUISequence">
;           <p>The default sequence of custom actions:
;           #include "out\InstallUISequence.html"    ;;Previously generated
;----------------------------------------------------------------------------


;----------------------------------------------------------------------------
;--- MAIN MACRO (call to generate html files for <$sequence "sequence tables">) -----------
;----------------------------------------------------------------------------
#(  ''
    #define MsiSeqTable

    ;--- Call MSIDIFF to generate "raw" output ------------------------------
    #evaluate ^^ ^call AddressCmd 'cscript.exe //NoLogo out\MsiDiff.vbs uisample.msi +{$Table} /NoSort /JustTableData /MacroPrefix @@ > out\{$Table}.TXT 2>&1'^

    ;--- Generate the start of the TABLE/file -------------------------------
    #output "out\{$Table}.HTML" ASIS
    <!-- Created by "SeqTable.DH" from MSIDIFF.VBS output! --><?NewLine>
    <?NewLine>
    <table class="SeqTable" border=1 cellSpacing=0 cellPadding=3><?NewLine>
    <tr align='left'>
        <th>Action</th>
        <th>Sequence<br>Number</th>
    </tr><?NewLine>

    ;--- Generate HTML (by including the data we captured above) ------------
    #include "out\{$Table}.TXT"   ;;Macros (defined below) execute to produce required HTML output

    ;--- End the table/file -------------------------------------------------
    <?NewLine>
    </table>
    #output
#)


;----------------------------------------------------------------------------
;--- SUPPORT MACROS (see "/MacroPrefix" on MSIDIFF.VBS command) -------------
;----------------------------------------------------------------------------
#(
  #define  @@TABLE
  #RexxVar @@Row.0 = 0           ;;Reset count
#)
#define  @@TABLECREATE
#( ''
  #define  @@/TABLE

  ;--- Sort the data --------------------------------------------------------
  #evaluate '' ^call ArraySort "@@Row"^

  ;--- Output the information -----------------------------------------------
  #{ for @@X = 1 to @@Row.0
     ;--- Split up info -----------------------------------------------------
     #DefineRexx ''
         parse var @@Row.@@X @@Ignore '00'x @@Sequence '00'x @@Action;
         @@ActionLink = '<' || '$SdkStdCa "' || @@Action || '">';
     #DefineRexx

     ;--- Output table row --------------------------------------------------
     <tr>
        <td><??@@ActionLink></td>
        <td><??@@Sequence></td>
     </tr><?NewLine>
  #}
#)
#(
  #define @@Row
  #evaluate ^^ ^<$@@Rexx2LoadInformationInSortableFormat {$?}>^
#)
#DefineRexx '@@Rexx2LoadInformationInSortableFormat'
    ;--- Get parameters we care about ---------------------------------------
    @@Action   = '{$Action}';
    @@Sequence = '{$Sequence}';

    ;--- Work out sort key (sort is textual - not numeric) ------------------
    @@SortKey = @@Sequence + 900000;

    ;--- Save information ---------------------------------------------------
    @@Sortable     = @@SortKey || '00'x || @@Sequence || '00'x || @@Action;
    @@RowCnt       = @@Row.0 + 1;
    @@Row.@@RowCnt = @@Sortable;
    @@Row.0        = @@RowCnt;
#DefineRexx


;----------------------------------------------------------------------------
;--- Now create the ".HTML" files for the tables (will #include as required) ---
;----------------------------------------------------------------------------
<$MsiSeqTable Table="InstallExecuteSequence">
<$MsiSeqTable Table="InstallUISequence">

"DumpMsiUpgradeCodes.cmd" is a more primative example that uses a batch file to extract some information.


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]: Sample MsiDiff Output - comcat.msm (merge module)[Next]: UpgradeCode, Simple Tool to dump MSI codes


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.