MsiQueryProductState (msi)
Last changed: anonymous

.
Summary
Returns the installed state for a product.

C# Signature:

[DllImport("msi.dll", SetLastError=true)]
static extern INSTALLSTATE MsiQueryProductState(string product);

VB Signature:

Declare Function MsiQueryProductState Lib "msi.dll" (ByVal product As String) As INSTALLSTATE

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

Makes use of the INSTALLSTATE enum, which can be found here - http://pinvoke.net/default.aspx/Enums.INSTALLSTATE

Tips & Tricks:

Please add some!

Sample Code:

using System;
using System.Runtime.InteropServices;

public class QueryProductState
{
    [DllImport("msi.dll")]
    private static extern INSTALLSTATE MsiQueryProductState(string product);

    public static void Main(string[] args)
    {
        INSTALLSTATE state = MsiQueryProductState("{11111111-2222-3333-4444-555555555555}");

        Console.WriteLine(state);
    }
}

Documentation