Commit 8bce656f authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

msi: Components with INSTALLSTATE_NOTUSED are considered present.

parent a36d06c0
...@@ -1124,6 +1124,7 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature) ...@@ -1124,6 +1124,7 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
UINT rc; UINT rc;
HKEY hkey; HKEY hkey;
INSTALLSTATE r; INSTALLSTATE r;
BOOL missing = FALSE;
TRACE("%s %s\n", debugstr_w(szProduct), debugstr_w(szFeature)); TRACE("%s %s\n", debugstr_w(szProduct), debugstr_w(szFeature));
...@@ -1166,8 +1167,7 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature) ...@@ -1166,8 +1167,7 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
return INSTALLSTATE_UNKNOWN; return INSTALLSTATE_UNKNOWN;
} }
r = INSTALLSTATE_LOCAL; for( p = components; *p != 2 ; p += 20)
for( p = components; (*p != 2) && (lstrlenW(p) > 20); p += 20)
{ {
if (!decode_base85_guid( p, &guid )) if (!decode_base85_guid( p, &guid ))
{ {
...@@ -1176,19 +1176,25 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature) ...@@ -1176,19 +1176,25 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
} }
StringFromGUID2(&guid, comp, GUID_SIZE); StringFromGUID2(&guid, comp, GUID_SIZE);
r = MsiGetComponentPathW(szProduct, comp, NULL, 0); r = MsiGetComponentPathW(szProduct, comp, NULL, 0);
if (r != INSTALLSTATE_LOCAL && r != INSTALLSTATE_SOURCE) TRACE("component %s state %d\n", debugstr_guid(&guid), r);
switch (r)
{ {
TRACE("component %s state %d\n", debugstr_guid(&guid), r); case INSTALLSTATE_NOTUSED:
r = INSTALLSTATE_ADVERTISED; case INSTALLSTATE_LOCAL:
case INSTALLSTATE_SOURCE:
break;
default:
missing = TRUE;
} }
} }
if (r == INSTALLSTATE_LOCAL && *p != 2) TRACE("%s %s -> %d\n", debugstr_w(szProduct), debugstr_w(szFeature), r);
ERR("%s -> %s\n", debugstr_w(szFeature), debugstr_w(components));
msi_free(components); msi_free(components);
return r; if (missing)
return INSTALLSTATE_ADVERTISED;
return INSTALLSTATE_LOCAL;
} }
/****************************************************************** /******************************************************************
......
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