msi: use SourceLIst Functions
Aric Stewart
aric at codeweavers.com
Tue Jul 12 09:38:44 CDT 2005
use the SourceList functions to get the source path in ConfigureProductExW
-------------- next part --------------
Index: dlls/msi/msi.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/msi.c,v
retrieving revision 1.91
diff -u -r1.91 msi.c
--- dlls/msi/msi.c 11 Jul 2005 18:01:39 -0000 1.91
+++ dlls/msi/msi.c 12 Jul 2005 14:37:00 -0000
@@ -271,13 +271,9 @@
MSIHANDLE handle = -1;
MSIPACKAGE* package;
UINT rc;
- HKEY hkey=0,hkey1=0;
DWORD sz;
- static const WCHAR szSouceList[] = {
- 'S','o','u','r','c','e','L','i','s','t',0};
- static const WCHAR szLUS[] = {
- 'L','a','s','t','U','s','e','d','S','o','u','r','c','e',0};
- WCHAR sourcepath[0x200];
+ WCHAR sourcepath[MAX_PATH];
+ WCHAR filename[MAX_PATH];
static const WCHAR szInstalled[] = {
' ','I','n','s','t','a','l','l','e','d','=','1',0};
LPWSTR commandline;
@@ -292,20 +288,17 @@
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);
- rc = RegQueryValueExW(hkey1, szLUS, NULL, NULL,(LPBYTE)sourcepath, &sz);
- if (rc != ERROR_SUCCESS)
- goto end;
+ MsiSourceListGetInfoW(szProduct, NULL, MSIINSTALLCONTEXT_USERMANAGED,
+ MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEstringW, sourcepath,
+ &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.
* 2, find the source dir for the files
@@ -345,7 +338,6 @@
HeapFree(GetProcessHeap(),0,commandline);
end:
- RegCloseKey(hkey);
if (handle != -1)
MsiCloseHandle(handle);
More information about the wine-patches
mailing list