msi: Append a backslash to the AppSearch directory path.

This commit is contained in:
James Hawkins 2008-10-16 01:08:45 -05:00 committed by Alexandre Julliard
parent b3f23da2d6
commit 3adf1e4e0e
2 changed files with 14 additions and 22 deletions

View File

@ -799,10 +799,12 @@ static UINT ACTION_AppSearchDr(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNATU
'D','r','L','o','c','a','t','o','r',' ',
'w','h','e','r','e',' ',
'S','i','g','n','a','t','u','r','e','_',' ','=',' ', '\'','%','s','\'',0};
LPWSTR parentName = NULL, path = NULL, parent = NULL;
LPWSTR parentName = NULL, parent = NULL;
WCHAR path[MAX_PATH];
WCHAR expanded[MAX_PATH];
MSIRECORD *row;
int depth;
DWORD sz;
UINT rc;
TRACE("%s\n", debugstr_w(sig->Name));
@ -829,33 +831,29 @@ static UINT ACTION_AppSearchDr(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNATU
ACTION_FreeSignature(&parentSig);
msi_free(parentName);
}
/* now look for path */
path = msi_dup_record_field(row,3);
sz = MAX_PATH;
MSI_RecordGetStringW(row, 3, path, &sz);
if (MSI_RecordIsNull(row,4))
depth = 0;
else
depth = MSI_RecordGetInteger(row,4);
ACTION_ExpandAnyPath(package, path, expanded, MAX_PATH);
msi_free(path);
if (parent)
{
path = msi_alloc((strlenW(parent) + strlenW(expanded) + 1) * sizeof(WCHAR));
if (!path)
{
rc = ERROR_OUTOFMEMORY;
goto end;
}
strcpyW(path, parent);
strcatW(path, expanded);
}
else
path = expanded;
strcpyW(path, expanded);
PathAddBackslashW(path);
rc = ACTION_SearchDirectory(package, sig, path, depth, appValue);
end:
if (path != expanded)
msi_free(path);
msi_free(parent);
msiobj_release(&row->hdr);

View File

@ -6783,19 +6783,13 @@ static void test_appsearch_drlocator(void)
sprintf(path, "%s\\", CURR_DIR);
r = MsiGetPropertyA(hpkg, "SIGPROP2", 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, "SIGPROP3", 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, "SIGPROP4", prop, &size);