Use the SourceList functions to get the source path in
ConfigureProductExW.
This commit is contained in:
parent
2d8cb29516
commit
27867e2502
|
@ -271,13 +271,9 @@ UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel,
|
||||||
MSIHANDLE handle = -1;
|
MSIHANDLE handle = -1;
|
||||||
MSIPACKAGE* package;
|
MSIPACKAGE* package;
|
||||||
UINT rc;
|
UINT rc;
|
||||||
HKEY hkey=0,hkey1=0;
|
|
||||||
DWORD sz;
|
DWORD sz;
|
||||||
static const WCHAR szSouceList[] = {
|
WCHAR sourcepath[MAX_PATH];
|
||||||
'S','o','u','r','c','e','L','i','s','t',0};
|
WCHAR filename[MAX_PATH];
|
||||||
static const WCHAR szLUS[] = {
|
|
||||||
'L','a','s','t','U','s','e','d','S','o','u','r','c','e',0};
|
|
||||||
WCHAR sourcepath[0x200];
|
|
||||||
static const WCHAR szInstalled[] = {
|
static const WCHAR szInstalled[] = {
|
||||||
' ','I','n','s','t','a','l','l','e','d','=','1',0};
|
' ','I','n','s','t','a','l','l','e','d','=','1',0};
|
||||||
LPWSTR commandline;
|
LPWSTR commandline;
|
||||||
|
@ -292,20 +288,17 @@ UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel,
|
||||||
return ERROR_CALL_NOT_IMPLEMENTED;
|
return ERROR_CALL_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = MSIREG_OpenUserProductsKey(szProduct,&hkey,FALSE);
|
|
||||||
if (rc != ERROR_SUCCESS)
|
|
||||||
goto end;
|
|
||||||
|
|
||||||
rc = RegOpenKeyW(hkey,szSouceList,&hkey1);
|
|
||||||
if (rc != ERROR_SUCCESS)
|
|
||||||
goto end;
|
|
||||||
|
|
||||||
sz = sizeof(sourcepath);
|
sz = sizeof(sourcepath);
|
||||||
rc = RegQueryValueExW(hkey1, szLUS, NULL, NULL,(LPBYTE)sourcepath, &sz);
|
MsiSourceListGetInfoW(szProduct, NULL, MSIINSTALLCONTEXT_USERMANAGED,
|
||||||
if (rc != ERROR_SUCCESS)
|
MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEstringW, sourcepath,
|
||||||
goto end;
|
&sz);
|
||||||
|
|
||||||
|
sz = sizeof(filename);
|
||||||
|
MsiSourceListGetInfoW(szProduct, NULL, MSIINSTALLCONTEXT_USERMANAGED,
|
||||||
|
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEstringW, filename, &sz);
|
||||||
|
|
||||||
|
strcatW(sourcepath,filename);
|
||||||
|
|
||||||
RegCloseKey(hkey1);
|
|
||||||
/*
|
/*
|
||||||
* ok 1, we need to find the msi file for this product.
|
* ok 1, we need to find the msi file for this product.
|
||||||
* 2, find the source dir for the files
|
* 2, find the source dir for the files
|
||||||
|
@ -345,7 +338,6 @@ UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel,
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(),0,commandline);
|
HeapFree(GetProcessHeap(),0,commandline);
|
||||||
end:
|
end:
|
||||||
RegCloseKey(hkey);
|
|
||||||
if (handle != -1)
|
if (handle != -1)
|
||||||
MsiCloseHandle(handle);
|
MsiCloseHandle(handle);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue