[DllImport("msi.dll", CharSet=CharSet.Unicode)]
static extern int MsiRecordGetString(IntPtr hRecord, int iField,
StringBuilder szValueBuf, ref int pcchValueBuf);
None.
Please add some!
private static string GetString(IntPtr hRecord, int field, int length)
{
var builder = new StringBuilder(length + 1);
var count = builder.Capacity;
if (MsiRecordGetString(hRecord, field, builder, ref count) != 0)
{
throw new Exception("MsiRecordGetString failed - " + Marshal.GetLastWin32Error());
}
return builder.ToString();
}
MSI interop library
http://sourceforge.net/project/showfiles.php?group_id=40188&package_id=110212