msi: PackagePath must also include the package name.

This commit is contained in:
James Hawkins 2007-07-02 20:19:46 -07:00 committed by Alexandre Julliard
parent 56129f252c
commit 08443b3bf7
2 changed files with 27 additions and 22 deletions

View File

@ -629,35 +629,43 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
if (szPackagePath)
{
LPWSTR p, check, path;
path = strdupW(szPackagePath);
p = strrchrW(path,'\\');
LPWSTR p, check, dir;
dir = strdupW(szPackagePath);
p = strrchrW(dir, '\\');
if (p)
{
p++;
*p=0;
}
*(++p) = 0;
else
{
msi_free(path);
path = msi_alloc(MAX_PATH*sizeof(WCHAR));
GetCurrentDirectoryW(MAX_PATH,path);
strcatW(path,cszbs);
msi_free(dir);
dir = msi_alloc(MAX_PATH*sizeof(WCHAR));
GetCurrentDirectoryW(MAX_PATH, dir);
lstrcatW(dir, cszbs);
p = (LPWSTR)szPackagePath;
}
msi_free( package->PackagePath );
package->PackagePath = msi_alloc((lstrlenW(dir) + lstrlenW(p) + 2) * sizeof(WCHAR));
if (!package->PackagePath)
{
msi_free(dir);
return ERROR_OUTOFMEMORY;
}
lstrcpyW(package->PackagePath, dir);
lstrcatW(package->PackagePath, cszbs);
lstrcatW(package->PackagePath, p);
check = msi_dup_property( package, cszSourceDir );
if (!check)
MSI_SetPropertyW(package, cszSourceDir, path);
MSI_SetPropertyW(package, cszSourceDir, dir);
msi_free(check);
check = msi_dup_property( package, cszSOURCEDIR );
if (!check)
MSI_SetPropertyW(package, cszSOURCEDIR, path);
msi_free( package->PackagePath );
package->PackagePath = path;
MSI_SetPropertyW(package, cszSOURCEDIR, dir);
msi_free(dir);
msi_free(check);
}

View File

@ -2244,11 +2244,8 @@ static void test_publishsourcelist(void)
r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAME, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
todo_wine
{
ok(!lstrcmpA(value, "msitest.msi"), "Expected 'msitest.msi', got %s\n", value);
ok(size == 11, "Expected 11, got %d\n", size);
}
ok(!lstrcmpA(value, "msitest.msi"), "Expected 'msitest.msi', got %s\n", value);
ok(size == 11, "Expected 11, got %d\n", size);
/* complete uninstall */
r = MsiInstallProductA(msifile, "FULL=1 REMOVE=ALL");