private static Int32 GetProductInfo(string propertyName, out string propertyValue)
{
var sbBuffer = new StringBuilder();
var len = sbBuffer.Capacity;
sbBuffer.Length = 0;
var status = MsiGetProductInfo(InstallerProductCode, propertyName, sbBuffer, ref len);
if (status == ErrorMoreData)
{
len++;
sbBuffer.EnsureCapacity(len);
status = MsiGetProductInfo(InstallerProductCode, InstalledProductNameProperty, sbBuffer, ref len);
}
propertyValue = sbBuffer.ToString();
return status;
}
}