Is there a tool or mechanism for retrieving the available public properties from a Windows MSI file?
Some vendors that supply MSI files don't document these themselves, so I'm curious to see if there is a way to expose these without the source code.
Lessmsi provides a command line as well as interactive application for retrieving any attribute from the .msi.
Interactively, open the .msi then go to Table view and select or type "Property". However while this gives the property names it doesn't give the valid values for said property.(Or I haven't discovered the right place to look.)
Command line to list Properties table to console (frustratingly, can't be captured with simple
> output.csv
redirect)lessmsi is a great tool that certainly works here if you're willing to pop open its GUI and do some manual investigation. However, I will say, that the following command does not reliably present all properties:
One way to (better) guarantee that you get all the possible properties is to actually perform either an installation, repair, or uninstall with the MSI file and log the process. The following command records only the properties and nothing else:
The above command is equivalent to:
My preferred method, however, is to not actually install/remove/repair (and to simply extract instead). The advantages this method has over lessmsi is that it doesn't require a 3rd-party utility (i.e. lessmsi), and it doesn't require you to mess with any installations. Given that you have enough disk space to actually install the program, you can do:
Note that the
<absolute_path_to_extract_to>
can point to a nonexistent directory (the command will create the directories necessary or fail).If you hate the installation UI for whatever reason you can append the
/qr
option, which will 'reduce' and possibly eliminate the UI without impairing the property logging process. Be warned however--if you go "lower" than the reduced UI (viz./qb
|/passive
or/qn
|/quiet
), your<msi_property_logfile>
may be missing some properties.Given that MSI file store public properties in an internal database, you can actually just query them out using VBScript and SQL.
Here's an example script that will return all properties stored in the MSI file. It is convention to use capital letters to define public properties, so that is how they are usually identifiable.
The way I'm doing it now is by using the Carbon Powershell module. To install the module type:
Then simply
Example:
I think that now probably the best way of doing it is using powershell. Here is a script that does the job really well: https://gallery.technet.microsoft.com/scriptcenter/Get-MsiDatabaseProperties-09d9c87c