msigetcomponentpath (msi)
Last changed: anonymous

.
Summary
Returns the full path to an installed component

C# Signature:

[DllImport("msi.dll", CharSet = CharSet.Unicode)]
public static extern UInt32 MsiGetComponentPath(string szProduct, string szComponent, [Out] StringBuilder lpPathBuf,  ref UInt32 pcchBuf);

VB Signature:

Declare Function MsiGetComponentPath Lib "msi.dll" (TODO) As TODO

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

StringBuilder sbPc = new StringBuilder(50);
StringBuilder sbFeat = new StringBuilder(100);
StringBuilder sbComp = new StringBuilder(50);

UInt32 i = MsiClass.MsiGetShortcutTargetW("C:\\temp\\word.lnk", sbPc, sbFeat, sbComp);
StringBuilder sbPth = new StringBuilder(500);
char[] pth = new char[500];
UInt32 chs = 500;
i = MsiClass.MsiGetComponentPath(sbPc.ToString(), sbComp.ToString(), sbPth, ref chs);

Documentation