msi: Only append a backslash to directories.
This commit is contained in:
parent
7497f1ab5c
commit
4aca381ff7
|
@ -837,6 +837,7 @@ static UINT ACTION_SearchDirectory(MSIPACKAGE *package, MSISIGNATURE *sig,
|
|||
LPCWSTR path, int depth, LPWSTR *appValue)
|
||||
{
|
||||
UINT rc;
|
||||
DWORD attr;
|
||||
LPWSTR val = NULL;
|
||||
|
||||
TRACE("%p, %p, %s, %d, %p\n", package, sig, debugstr_w(path), depth,
|
||||
|
@ -881,7 +882,9 @@ static UINT ACTION_SearchDirectory(MSIPACKAGE *package, MSISIGNATURE *sig,
|
|||
}
|
||||
}
|
||||
|
||||
if (val && val[lstrlenW(val) - 1] != '\\')
|
||||
attr = GetFileAttributesW(val);
|
||||
if ((attr & FILE_ATTRIBUTE_DIRECTORY) &&
|
||||
val && val[lstrlenW(val) - 1] != '\\')
|
||||
{
|
||||
val = msi_realloc(val, (lstrlenW(val) + 2) * sizeof(WCHAR));
|
||||
if (!val)
|
||||
|
|
|
@ -7135,10 +7135,7 @@ static void test_appsearch_drlocator(void)
|
|||
sprintf(path, "%s\\FileName1", CURR_DIR);
|
||||
r = MsiGetPropertyA(hpkg, "SIGPROP1", 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);
|
||||
|
@ -7187,10 +7184,7 @@ static void test_appsearch_drlocator(void)
|
|||
sprintf(path, "%s\\FileName3.dll", CURR_DIR);
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue