12

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.

  • 8
    Microsoft's ORCA, Pantaray's SuperORCA and most every other MSI edit will allow you to browse/edit any table including the Property table. Did you have a specific work-flow or use-case outside just poking-around in the MSI? – jscott May 1 '12 at 13:14
  • 2
    I wanted to understand the available public properties so they could be passed accurately during installation, without having to query the vendor or documentation (as this is not always possible). With Puppet we can pass in MSI properties during installation (we wrap misexec.exe), so its handy to have this ability. – Ken Barber May 1 '12 at 22:09
  • 1
    There could be other public properties that you can pass to control the installation although they're not listed in the Properties table. Properties can be set dynamically depending on a condition, Registry search for example. So vendor documentation is the better source of information. – Alexey Ivanov May 2 '12 at 7:45
  • You can also run the installation with verbose logging to see how properties change their values. – Alexey Ivanov May 2 '12 at 7:46
  • Sorry about the delay - I've tried Orca and its fascinating, but I've confirmed the behaviour you describe @AlexeyIvanov - that is, some properties won't appear. I confirmed this with splunk.msi and its docs. I'm guessing the ones that appear in Orca have defaults, but this isn't a canonical list. Can you explain a bit more about the verbose logging methodology? – Ken Barber May 2 '12 at 21:11
8

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 l -t Property ...\path\to\setup.msi
1

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.

1

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:

lessmsi l -t Property <msi_name>

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:

<msi_name> /lp! <msi_property_logfile>

The above command is equivalent to:

msiexec /lp! <msi_property_logfile> /i <msi_name>

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:

msiexec /a <msi_name> /lp! <msi_property_logfile> TARGETDIR=<absolute_path_to_extract_to>

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.

  • The problem of this method is: you have to actually run the installer. Even you install it to a nonstandard targetdir, you still messed up the registers. – Wang Apr 25 at 9:55
0

The way I'm doing it now is by using the Carbon Powershell module. To install the module type:

Install-Module -Name 'Carbon' -AllowClobber

Then simply

msi your_msi_path.msi

Example:

msi putty-64bit-0.70-installer.msi

ProductName                 ProductVersion Manufacturer ProductCode                         

-----------                 -------------- ------------ -----------                         

PuTTY release 0.70 (64-bit) 0.70.0.0       Simon Tatham 45b3032f-22cc-40cd-9e97-4da7095fa5a2
-1

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

  • This answer is just a link, which can change/disappear. – David Makogon May 15 '16 at 11:12
  • There are other answers that are simply a link. I don't feel comfortable copying and pasting other people code.I think my answer gives an alternative option and I really don't understand the down vote. – gigi May 17 '16 at 12:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.