msi: Components with INSTALLSTATE_NOTUSED are considered present.

This commit is contained in:
Mike McCormack 2006-07-21 14:04:44 +09:00 committed by Alexandre Julliard
parent a36d06c003
commit 8bce656fd3
1 changed files with 15 additions and 9 deletions

View File

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