Alex Rivera | Logout

How to extract data (file count) from MSI "File" Table

Asked 2009-03-20T21:43:10.047
10

In our build process there is currently the potential for non-code based files (such as image files) to be added to our web project, but not included in the MSI installer built by WiX.

To help prevent this, I want to perform the following in the AfterBuild target for our WiX project:

  • Get a count of all files built (output from web deployment project)
  • Get a count of all files built into MSI (from "File" table in MSI)
  • Compare counts and fail build if they don't match

If I fire up Orca I can easily see the File table and count, but I don't know how to automate this from MSBuild. Is there some API or other mechanism to get this information out of an MSI?

I don't mind writing a custom MSBuild task to extract the MSI File table count.

Edit
Report

1 Answer

0

WinRAR identifies the MSI as a self-extracting CAB archive (after giving it a .rar extension). I suppose you could copy the file somewhere, rename it, unpack it with WinRAR, then count the files. The files will not have their original names, though.

This seems a bit outdated and I don't know if it could be of any help.

answered 2009-03-21T01:16:43.997

Your Answer