MsiGetProductInfo returning ERROR_UNKNOWN_PRODUCT for an installed product
I am trying to programmatically query for information from the installer
project. This information is defined in the installer and I don't want to
duplicate it in code. I need to get the Publisher installer property (and
a few others), but can't seem to get things to work.
I am querying using:
[DllImport("msi.dll", CharSet = CharSet.Unicode)]
private static extern Int32 MsiGetProductInfo(
string product,
string property,
[Out] StringBuilder valueBuf,
ref Int32 len);
...
int length = 512;
StringBuilder builder = new StringBuilder(length);
var result = MsiGetProductInfo(
"{censored}",
"Publisher",
builder,
ref length);
Using RegEdit, I can see an uninstallable product:
{censored}_is1
And this is my application with a "Publisher" key that is what I expect. I
am not sure why the "_is1" suffix is there. The installer was made using
Inno Setup, maybe that is related. I have tried adding this suffix on the
product code in the call to MsiGetProductInfo but it had no effect.
The call returns 1605 which is ERROR_UNKNOWN_PRODUCT.
How do I properly query for the publisher of this product?
No comments:
Post a Comment