msi: Handle searching for a file with no signature.

This commit is contained in:
James Hawkins 2008-10-20 04:19:57 -05:00 committed by Alexandre Julliard
parent 326a1b6c47
commit c48497d0e6
2 changed files with 18 additions and 20 deletions

View File

@ -164,6 +164,19 @@ static LPWSTR app_search_file(LPWSTR path, MSISIGNATURE *sig)
static const WCHAR root[] = {'\\',0};
if (!sig->File)
{
PathRemoveFileSpecW(path);
PathAddBackslashW(path);
attr = GetFileAttributesW(path);
if (attr != INVALID_FILE_ATTRIBUTES &&
(attr & FILE_ATTRIBUTE_DIRECTORY))
return strdupW(path);
return NULL;
}
attr = GetFileAttributesW(path);
if (attr == INVALID_FILE_ATTRIBUTES || attr == FILE_ATTRIBUTE_DIRECTORY)
return NULL;

View File

@ -6594,10 +6594,7 @@ static void test_appsearch_reglocator(void)
sprintf(path, "%s\\", CURR_DIR);
r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
todo_wine
{
ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
}
ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
size = MAX_PATH;
r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size);
@ -6672,19 +6669,13 @@ static void test_appsearch_reglocator(void)
*ptr = '\0';
r = MsiGetPropertyA(hpkg, "SIGPROP24", prop, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
todo_wine
{
ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
}
ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
size = MAX_PATH;
sprintf(path, "%s\\", CURR_DIR);
r = MsiGetPropertyA(hpkg, "SIGPROP25", prop, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
todo_wine
{
ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
}
ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
size = MAX_PATH;
r = MsiGetPropertyA(hpkg, "SIGPROP26", prop, &size);
@ -6953,10 +6944,7 @@ static void test_appsearch_inilocator(void)
sprintf(path, "%s\\", CURR_DIR);
r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
todo_wine
{
ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
}
ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
size = MAX_PATH;
lstrcpyA(path, CURR_DIR);
@ -6964,10 +6952,7 @@ static void test_appsearch_inilocator(void)
*(ptr + 1) = '\0';
r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
todo_wine
{
ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
}
ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
size = MAX_PATH;
r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size);