Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

When MsiGetProductInfo cannot get the existed Info


2 replies to this topic

HermioneJJ

HermioneJJ
  • Members
  • 27 posts

Posted 29 March 2006 - 14:55

Hi All,
I need to search the users' computer to see if some products have been installed. And I use the function MsiGetProductInfo(...) ..I used it like this:

UINT iResult = MsiGetProductInfo(
"{76D6****-****-****-****-************}",
INSTALLPROPERTY_INSTALLEDPRODUCTNAME,
wszProductName, &dwProductName);
if ( ERROR_SUCCESS == iResult )
{
MsiSetProperty( hInstall, "InventorView_EXIST", wszProductName );
}

And I installed 4 product(ALLUser) to test the function.
It works right in 3 products but 1 failed. when I debuged that failed one I found the iResult was set 1605...which means ERROR_UNKNOWN_PRODUCT...The product is unadvertised or uninstalled....But it is not uninstalled! mad.gif
I searched the abnormal product's ProductCode in registry. In the key--HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall... it contains all infomation of the product (including DisplayName...I think it is the INSTALLPROPERTY_INSTALLEDPRODUCTNAME I try to get)
And then in the "Add/Remove Programs" entry it can be uninstall successfully.

Do any one knows why function MsiGetProductInfo cannot get the information for me?
Thanks in advance?

dtieuf

dtieuf
  • Full Members
  • 31 posts

Posted 29 March 2006 - 15:25

Hi,

Have you tried MsiQueryProductState ?

HermioneJJ

HermioneJJ
  • Members
  • 27 posts

Posted 30 March 2006 - 05:14

Thanks, dtieuf. smile.gif

I found the problem...it is all my fault...I used the old ProductCode. So it cannot get the information...there is only one letter different..and I missed... blink.gif

Hermione Cai