Fix folder resolution.
authorAric Stewart <aric@codeweavers.com>
Wed, 22 Dec 2004 17:13:26 +0000 (17:13 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Wed, 22 Dec 2004 17:13:26 +0000 (17:13 +0000)
dlls/msi/action.c
dlls/msi/package.c

index 54c0d4be48d3f8f94c058c5c2140cf3ed0ebc4a9..dd8449360475eca3c8f9a1dea3c99b4c56ebfced 100644 (file)
@@ -281,7 +281,7 @@ static LPWSTR PACKAGE_GetProperty(MSIPACKAGE *package, LPCWSTR prop)
     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));
index 35abed6d73548c6887bd926b4e6b81164a4a2e33..6a3fa9ff0ef15e596b6cac1cda6cb9174c82f0a6 100644 (file)
@@ -169,6 +169,7 @@ http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/prope
 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 @@ static VOID set_installer_properties(MSIPACKAGE *package)
 {'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 @@ Privileged
     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 @@ UINT MSI_GetPropertyW(MSIPACKAGE *package, LPCWSTR szName,
     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;