msi: Only check the file signature if the candidate file is not a directory.

This commit is contained in:
James Hawkins 2008-10-20 04:20:30 -05:00 committed by Alexandre Julliard
parent 1fb22654e4
commit 0ed516908b
2 changed files with 10 additions and 14 deletions

View File

@ -760,18 +760,17 @@ static UINT ACTION_RecurseSearchDirectory(MSIPACKAGE *package, LPWSTR *appValue,
hFind = FindFirstFileW(buf, &findData);
if (hFind != INVALID_HANDLE_VALUE)
{
BOOL matches;
/* assuming Signature can't contain wildcards for the file name,
* so don't bother with FindNextFileW here.
*/
rc = ACTION_FileMatchesSig(sig, &findData, buf, &matches);
if (rc == ERROR_SUCCESS && matches)
if (!(findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{
TRACE("found file, returning %s\n", debugstr_w(buf));
*appValue = buf;
}
BOOL matches;
rc = ACTION_FileMatchesSig(sig, &findData, buf, &matches);
if (rc == ERROR_SUCCESS && matches)
{
TRACE("found file, returning %s\n", debugstr_w(buf));
*appValue = buf;
}
}
FindClose(hFind);
}

View File

@ -7163,10 +7163,7 @@ static void test_appsearch_drlocator(void)
size = MAX_PATH;
r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
todo_wine
{
ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
}
ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop);
size = MAX_PATH;
sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR);