msi: Also check the LocalPackage install property when searching for the product package.
This commit is contained in:
parent
d500dc4f31
commit
6e63953b4c
|
@ -372,6 +372,53 @@ done:
|
|||
return r;
|
||||
}
|
||||
|
||||
static UINT msi_open_package(LPCWSTR product, MSIINSTALLCONTEXT context,
|
||||
MSIPACKAGE **package)
|
||||
{
|
||||
UINT r;
|
||||
DWORD sz;
|
||||
HKEY props;
|
||||
LPWSTR localpack;
|
||||
WCHAR sourcepath[MAX_PATH];
|
||||
WCHAR filename[MAX_PATH];
|
||||
|
||||
static const WCHAR szLocalPackage[] = {
|
||||
'L','o','c','a','l','P','a','c','k','a','g','e',0};
|
||||
|
||||
if (context == MSIINSTALLCONTEXT_MACHINE)
|
||||
r = MSIREG_OpenLocalSystemInstallProps(product, &props, FALSE);
|
||||
else
|
||||
r = MSIREG_OpenCurrentUserInstallProps(product, &props, FALSE);
|
||||
|
||||
if (r != ERROR_SUCCESS)
|
||||
return ERROR_BAD_CONFIGURATION;
|
||||
|
||||
localpack = msi_reg_get_val_str(props, szLocalPackage);
|
||||
if (localpack)
|
||||
{
|
||||
lstrcpyW(sourcepath, localpack);
|
||||
msi_free(localpack);
|
||||
}
|
||||
|
||||
if (!localpack || GetFileAttributesW(sourcepath) == INVALID_FILE_ATTRIBUTES)
|
||||
{
|
||||
sz = sizeof(sourcepath);
|
||||
MsiSourceListGetInfoW(product, NULL, context, MSICODE_PRODUCT,
|
||||
INSTALLPROPERTY_LASTUSEDSOURCEW, sourcepath, &sz);
|
||||
|
||||
sz = sizeof(filename);
|
||||
MsiSourceListGetInfoW(product, NULL, context, MSICODE_PRODUCT,
|
||||
INSTALLPROPERTY_PACKAGENAMEW, filename, &sz);
|
||||
|
||||
lstrcatW(sourcepath, filename);
|
||||
}
|
||||
|
||||
if (GetFileAttributesW(sourcepath) == INVALID_FILE_ATTRIBUTES)
|
||||
return ERROR_INSTALL_SOURCE_ABSENT;
|
||||
|
||||
return MSI_OpenPackageW(sourcepath, package);
|
||||
}
|
||||
|
||||
UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel,
|
||||
INSTALLSTATE eInstallState, LPCWSTR szCommandLine)
|
||||
{
|
||||
|
@ -380,7 +427,6 @@ UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel,
|
|||
UINT r;
|
||||
DWORD sz;
|
||||
WCHAR sourcepath[MAX_PATH];
|
||||
WCHAR filename[MAX_PATH];
|
||||
LPWSTR commandline;
|
||||
|
||||
static const WCHAR szInstalled[] = {
|
||||
|
@ -407,16 +453,7 @@ UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel,
|
|||
if (r != ERROR_SUCCESS)
|
||||
return r;
|
||||
|
||||
sz = sizeof(sourcepath);
|
||||
MsiSourceListGetInfoW(szProduct, NULL, context, MSICODE_PRODUCT,
|
||||
INSTALLPROPERTY_LASTUSEDSOURCEW, sourcepath, &sz);
|
||||
|
||||
sz = sizeof(filename);
|
||||
MsiSourceListGetInfoW(szProduct, NULL, context, MSICODE_PRODUCT,
|
||||
INSTALLPROPERTY_PACKAGENAMEW, filename, &sz);
|
||||
|
||||
lstrcatW(sourcepath, filename);
|
||||
r = MSI_OpenPackageW(sourcepath, &package);
|
||||
r = msi_open_package(szProduct, context, &package);
|
||||
if (r != ERROR_SUCCESS)
|
||||
return r;
|
||||
|
||||
|
|
|
@ -5118,9 +5118,9 @@ static void test_MsiConfigureProductEx(void)
|
|||
r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
|
||||
INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT,
|
||||
"PROPVAR=42");
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||
todo_wine
|
||||
{
|
||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||
ok(!delete_pf("msitest\\hydrogen", TRUE), "File not removed\n");
|
||||
ok(!delete_pf("msitest\\helium", TRUE), "File not removed\n");
|
||||
ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
|
||||
|
@ -5154,11 +5154,8 @@ static void test_MsiConfigureProductEx(void)
|
|||
r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
|
||||
INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT,
|
||||
"PROPVAR=42");
|
||||
todo_wine
|
||||
{
|
||||
ok(r == ERROR_INSTALL_SOURCE_ABSENT,
|
||||
"Expected ERROR_INSTALL_SOURCE_ABSENT, got %d\n", r);
|
||||
}
|
||||
ok(r == ERROR_INSTALL_SOURCE_ABSENT,
|
||||
"Expected ERROR_INSTALL_SOURCE_ABSENT, got %d\n", r);
|
||||
ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
|
||||
ok(pf_exists("msitest\\helium"), "File not installed\n");
|
||||
ok(pf_exists("msitest\\lithium"), "File not installed\n");
|
||||
|
@ -5219,11 +5216,8 @@ static void test_MsiConfigureProductEx(void)
|
|||
r = MsiConfigureProductExA("{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}",
|
||||
INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT,
|
||||
"PROPVAR=42");
|
||||
todo_wine
|
||||
{
|
||||
ok(r == ERROR_INSTALL_SOURCE_ABSENT,
|
||||
"Expected ERROR_INSTALL_SOURCE_ABSENT, got %d\n", r);
|
||||
}
|
||||
ok(r == ERROR_INSTALL_SOURCE_ABSENT,
|
||||
"Expected ERROR_INSTALL_SOURCE_ABSENT, got %d\n", r);
|
||||
ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
|
||||
ok(pf_exists("msitest\\helium"), "File not installed\n");
|
||||
ok(pf_exists("msitest\\lithium"), "File not installed\n");
|
||||
|
|
Loading…
Reference in New Issue