msi: ACTION_RegisterProduct store all InstallProperties

James Hawkins truiken at gmail.com
Sat Mar 1 16:08:57 CST 2008


On Sat, Mar 1, 2008 at 4:02 PM, Adam Strzelecki <ono at java.pl> wrote:
> Hello,
>
>
>  > I think you need to read through the implementation of
>  > MSI_GetProductInfo more closely and also read the MsiGetProductInfo
>  > tests in tests/msi.c and the test_publish:RegisterProduct tests in
>  > tests/install.c.
>
>  I think I did, and looking at the tests I see they are testing
>  properties only at Uninstall key, and I think this is wrong, or at
>  least incomplete, as quoted below:
>
>  >     res = RegOpenKeyA(uninstall, prodcode, &prodkey);
>  >     ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
>  >
>  >     CHECK_REG_DWORD(prodkey, "Version", 0x1010001);
>  >     CHECK_REG_DWORD(prodkey, "VersionMajor", 1);
>  >     CHECK_REG_DWORD(prodkey, "VersionMinor", 1);
>  >     CHECK_REG_DWORD(prodkey, "WindowsInstaller", 1);
>
>
>  While MSI_GetProductInfo is reading VersionMajor, VersionMinor, ...
>  etc from InstallProperties key (from szInstallProperties_fmt or
>  szInstaller_LocalSystemProductCodes_fmt), but NOT from Uninstall key
>  as quotes below:
>
>  >     if (classes)
>  >         MSIREG_OpenLocalSystemProductKey(szProduct, &userdata, FALSE);
>  >     else
>  >         MSIREG_OpenInstallPropertiesKey(szProduct, &userdata, FALSE);
>  >
>  >     if (!lstrcmpW(szAttribute, INSTALLPROPERTY_HELPLINKW) ||
>  >         !lstrcmpW(szAttribute, INSTALLPROPERTY_HELPTELEPHONEW) ||
>  >         !lstrcmpW(szAttribute, INSTALLPROPERTY_INSTALLDATEW) ||
>  >         !lstrcmpW(szAttribute,
>  > INSTALLPROPERTY_INSTALLEDPRODUCTNAMEW) ||
>  >         !lstrcmpW(szAttribute, INSTALLPROPERTY_INSTALLLOCATIONW) ||
>  >         !lstrcmpW(szAttribute, INSTALLPROPERTY_INSTALLSOURCEW) ||
>  >         !lstrcmpW(szAttribute, INSTALLPROPERTY_LOCALPACKAGEW) ||
>  >         !lstrcmpW(szAttribute, INSTALLPROPERTY_PUBLISHERW) ||
>  >         !lstrcmpW(szAttribute, INSTALLPROPERTY_URLINFOABOUTW) ||
>  >         !lstrcmpW(szAttribute, INSTALLPROPERTY_URLUPDATEINFOW) ||
>  >         !lstrcmpW(szAttribute, INSTALLPROPERTY_VERSIONMINORW) ||
>  >         !lstrcmpW(szAttribute, INSTALLPROPERTY_VERSIONMAJORW) ||
>  >         !lstrcmpW(szAttribute, INSTALLPROPERTY_VERSIONSTRINGW) ||
>  >         !lstrcmpW(szAttribute, INSTALLPROPERTY_PRODUCTIDW) ||
>  >         !lstrcmpW(szAttribute, INSTALLPROPERTY_REGCOMPANYW) ||
>  >         !lstrcmpW(szAttribute, INSTALLPROPERTY_REGOWNERW))
>  >     {
>  >         if (!prodkey)
>  >         {
>  >             r = ERROR_UNKNOWN_PRODUCT;
>  >             goto done;
>  >         }
>  >
>  >         if (!userdata)
>  >             return ERROR_UNKNOWN_PROPERTY;
>  >
>  >         if (!lstrcmpW(szAttribute,
>  > INSTALLPROPERTY_INSTALLEDPRODUCTNAMEW))
>  >             szAttribute = display_name;
>  >         else if (!lstrcmpW(szAttribute,
>  > INSTALLPROPERTY_VERSIONSTRINGW))
>  >             szAttribute = display_version;
>  >
>  >         val = msi_reg_get_value(userdata, szAttribute, &type);
>  >         if (!val)
>  >             val = empty;
>  >     }
>
>
>  So it does not find any of those properties in the registry, because
>  they're not written there by ACTION_RegisterProduct.
>  And fixing this is the intention of my patch.
>

Which is wrong, which you'll see when I submit my next patch which
tests your theory.

-- 
James Hawkins



More information about the wine-devel mailing list