Thursday 21 July 2011

MSI Validation using Darice.cub

MSI Validation runs tests on the MSI package, these tests are called Internal Consistency Evaluators (ICE). They can find bad conditions, duplicate file targets, invalid records, per/user issues and so on...
Tools required for validating MSI will be available after installing "Windows Installer 4.5 SDK".
Hence we will first install “msi45sdk.msi” (Windows Installer 4.5 SDK).
 
 
 
Windows Installer 4.5 SDK will be installed under "C:\Program Files\"

 

In "Windows Installer 4.5 SDK" folder we can see "TOOLS" folder.
 

We can see many tools in this folder like orca, msidb, msival2, etc.

MsiVal2.msi extracts MsiVal2.exe and some .cub files when installed. MsiVal2.exe is a command line tool that will run the validation test for us. 

 
Now Install "MsiVal2.msi".

 
 
 

Click on Complete

 
After completing the installation of Msival2.msi ,we get an "MsiVal2" folder under "C:\Program Files\". The CUB files in this folder have the actual ICEs to execute. Darice.cub contains all of the MSI ICE's and equates to Full MSI Validation Suite.

For validating an MSI, copy that msi and source folders associated with it (if any) to the location where MsiVal2.exe is installed (i.e., C:\Program Files\MsiVal2\).

Run MSI Validation from the command line:
MsiVal2.exe <Msi Package> <.cub file> /l "Output file" /f

Example:
MsiVal2.exe "C:\Program Files\MsiVal2\BankID_Security.msi" "darice.cub” /l “C:\New  Folder\Validation.log” /f
 

Here, we have created a cmd file (New Test Document.cmd) to run MSI Validation from the command line.

After executing this file we will get Info, Warnings and Errors in the "validation.log" file.


We will get the below window on execution of "New Test Document.cmd".


MSI Validation typically contains 3 levels of output (Info, Warnings, and Errors) which is shown in the below "validation.log".

No comments:

Post a Comment