MSI: fix folder resolution
Mike McCormack
mike at codeweavers.com
Wed Dec 22 03:42:53 CST 2004
ChangeLog:
<aric at codeweavers.com>
* fix folder resolution
-------------- next part --------------
diff -ur dlls/msi.old/action.c dlls/msi/action.c
--- dlls/msi.old/action.c 2004-12-22 18:39:30.000000000 +0900
+++ dlls/msi/action.c 2004-12-22 18:39:58.000000000 +0900
@@ -281,7 +281,7 @@
UINT r;
r = MSI_GetPropertyW(package, prop, NULL, &sz);
- if (r != ERROR_SUCCESS)
+ if (r != ERROR_SUCCESS && r != ERROR_MORE_DATA)
return NULL;
sz++;
str = HeapAlloc(GetProcessHeap(),0,sz*sizeof(WCHAR));
diff -ur dlls/msi.old/package.c dlls/msi/package.c
--- dlls/msi.old/package.c 2004-12-22 18:39:30.000000000 +0900
+++ dlls/msi/package.c 2004-12-22 18:39:58.000000000 +0900
@@ -169,6 +169,7 @@
static VOID set_installer_properties(MSIPACKAGE *package)
{
WCHAR pth[MAX_PATH];
+ WCHAR *ptr;
OSVERSIONINFOA OSVersion;
DWORD verval;
WCHAR verstr[10], msiver[10];
@@ -210,6 +211,8 @@
{'P','e','r','s','o','n','a','l','F','o','l','d','e','r',0};
static const WCHAR WF[] =
{'W','i','n','d','o','w','s','F','o','l','d','e','r',0};
+ static const WCHAR WV[] =
+{'W','i','n','d','o','w','s','V','o','l','u','m','e',0};
static const WCHAR TF[]=
{'T','e','m','p','F','o','l','d','e','r',0};
static const WCHAR szAdminUser[] =
@@ -332,6 +335,12 @@
strcatW(pth,cszbs);
MSI_SetPropertyW(package, WF, pth);
+ SHGetFolderPathW(NULL,CSIDL_WINDOWS,NULL,0,pth);
+ ptr = strchrW(pth,'\\');
+ if (ptr)
+ *ptr = 0;
+ MSI_SetPropertyW(package, WV, pth);
+
GetTempPathW(MAX_PATH,pth);
MSI_SetPropertyW(package, TF, pth);
@@ -768,6 +777,9 @@
if (rc == ERROR_SUCCESS)
TRACE("returning %s for property %s\n", debugstr_w(szValueBuf),
debugstr_w(szName));
+ else if (rc == ERROR_MORE_DATA)
+ TRACE("need %i sized buffer for %s\n", *pchValueBuf,
+ debugstr_w(szName));
else
{
*pchValueBuf = 0;
More information about the wine-patches
mailing list