Commit 24ede2f9 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: If the UserData product key exists, but the user product key doesn't, the product is absent.

parent 3bf32f27
......@@ -765,6 +765,7 @@ INSTALLSTATE WINAPI MsiQueryProductStateW(LPCWSTR szProduct)
INSTALLSTATE state = INSTALLSTATE_UNKNOWN;
HKEY hkey = 0, props = 0;
DWORD sz;
BOOL userkey_exists = FALSE;
static const int GUID_LEN = 38;
static const WCHAR szInstallProperties[] = {
......@@ -780,11 +781,12 @@ INSTALLSTATE WINAPI MsiQueryProductStateW(LPCWSTR szProduct)
return INSTALLSTATE_INVALIDARG;
rc = MSIREG_OpenUserProductsKey(szProduct,&hkey,FALSE);
if (rc != ERROR_SUCCESS)
goto end;
state = INSTALLSTATE_ADVERTISED;
RegCloseKey(hkey);
if (rc == ERROR_SUCCESS)
{
userkey_exists = TRUE;
state = INSTALLSTATE_ADVERTISED;
RegCloseKey(hkey);
}
rc = MSIREG_OpenUserDataProductKey(szProduct,&hkey,FALSE);
if (rc != ERROR_SUCCESS)
......@@ -804,6 +806,9 @@ INSTALLSTATE WINAPI MsiQueryProductStateW(LPCWSTR szProduct)
else
state = INSTALLSTATE_UNKNOWN;
if (state == INSTALLSTATE_DEFAULT && !userkey_exists)
state = INSTALLSTATE_ABSENT;
end:
RegCloseKey(props);
RegCloseKey(hkey);
......
......@@ -439,10 +439,7 @@ static void test_MsiQueryProductState(void)
/* user product key does not exist */
state = MsiQueryProductStateA(prodcode);
todo_wine
{
ok(state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
}
ok(state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state);
LocalFree(usersid);
RegDeleteValueA(props, "WindowsInstaller");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment