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:
Action | Sequence Number |
---|---|
FatalError | -3 |
UserExit | -2 |
ExitDialog | -1 |
LaunchConditions | 100 |
PrepareDlg | 140 |
FindRelatedProducts | 200 |
AppSearch | 400 |
CCPSearch | 500 |
RMCCPSearch | 600 |
CostInitialize | 800 |
FileCost | 900 |
CostFinalize | 1000 |
MigrateFeatureStates | 1200 |
WelcomeDlg | 1230 |
ResumeDlg | 1240 |
MaintenanceWelcomeDlg | 1250 |
ProgressDlg | 1280 |
ExecuteAction | 1300 |
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.