Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to be able to check for the installation of a particular feature from an msi installer. For context, I need to check whether the "Powershell Cmdlets" feature (TFPS from Feature table in Orca) was installed from the Team Foundation Server 2010 Power Tools installer (tfpt.msi).

I know how to check for installation of the product itself using WMI win32_product and the product code {B6DC31D8-A303-4D14-9C88-59F183F55BEC}, but the TFPS feature doesn't even install by default so it's quite common for it to be missing.

Is this possible?

share|improve this question

Using the MsiQueryFeatureState should do it. You can do so from C++ or other languages. In VBScript it would be something like this (note that this is for a different MSI, please update the product GUID and feature name to suit your purpose):

dim installer, state

' Connect to Windows Installer object
set installer = CreateObject("WindowsInstaller.Installer")
state = installer.featurestate ("{4F41AD68-89F2-4262-A32C-2F70B01FCE9E}","PhotoStory")

If ( state = -2 ) then
 elseif (state = -1) then
 elseif (state = 2) then
 elseif (state = 2) then
 elseif (state = 3) then
 elseif (state = 4) then
End If

The interesting state is INSTALLSTATE_LOCAL. This means the feature is installed locally on the local disk.

Here is more information on the down to the wire C-style win32 call:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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