msiQueryProductState

Code found from a website

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);

}

}