msi: fixes to uncompressed sources

Aric Stewart aric at codeweavers.com
Tue May 17 14:36:58 CDT 2005


Correctly use short filenames from uncompressed file sources.
also default feature and component install states to ABSENT instead of 
UNKNOWN
-------------- next part --------------
Index: dlls/msi/action.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/action.c,v
retrieving revision 1.114
diff -u -r1.114 action.c
--- dlls/msi/action.c	16 May 2005 21:37:35 -0000	1.114
+++ dlls/msi/action.c	17 May 2005 19:35:35 -0000
@@ -381,6 +381,13 @@
         memmove(filename, p+1, (strlenW(p+1)+1)*sizeof(WCHAR));
 }
 
+inline static void reduce_to_shortfilename(WCHAR* filename)
+{
+    LPWSTR p = strchrW(filename,'|');
+    if (p)
+        *p = 0;
+}
+
 WCHAR *load_dynamic_stringW(MSIRECORD *row, INT index)
 {
     UINT rc;
@@ -599,6 +606,7 @@
     {
         HeapFree(GetProcessHeap(),0,package->files[i].File);
         HeapFree(GetProcessHeap(),0,package->files[i].FileName);
+        HeapFree(GetProcessHeap(),0,package->files[i].ShortName);
         HeapFree(GetProcessHeap(),0,package->files[i].Version);
         HeapFree(GetProcessHeap(),0,package->files[i].Language);
         HeapFree(GetProcessHeap(),0,package->files[i].SourcePath);
@@ -1609,7 +1617,7 @@
     sz = 96;       
     MSI_RecordGetStringW(row,6,package->components[index].KeyPath,&sz);
 
-    package->components[index].Installed = INSTALLSTATE_UNKNOWN;
+    package->components[index].Installed = INSTALLSTATE_ABSENT;
     package->components[index].Action = INSTALLSTATE_UNKNOWN;
     package->components[index].ActionRequest = INSTALLSTATE_UNKNOWN;
 
@@ -1676,7 +1684,7 @@
 
     package->features[index].Attributes= MSI_RecordGetInteger(row,8);
 
-    package->features[index].Installed = INSTALLSTATE_UNKNOWN;
+    package->features[index].Installed = INSTALLSTATE_ABSENT;
     package->features[index].Action = INSTALLSTATE_UNKNOWN;
     package->features[index].ActionRequest = INSTALLSTATE_UNKNOWN;
 
@@ -1848,8 +1856,10 @@
     HeapFree(GetProcessHeap(), 0, buffer);
 
     package->files[index].FileName = load_dynamic_stringW(row,3);
-
     reduce_to_longfilename(package->files[index].FileName);
+
+    package->files[index].ShortName = load_dynamic_stringW(row,3);
+    reduce_to_shortfilename(package->files[index].ShortName);
     
     package->files[index].FileSize = MSI_RecordGetInteger(row,4);
     package->files[index].Version = load_dynamic_stringW(row, 5);
@@ -2980,8 +2990,7 @@
 
     if (file->Attributes & msidbFileAttributesNoncompressed)
     {
-        sz = MAX_PATH;
-        MSI_GetPropertyW(package, cszSourceDir, path, &sz);
+        TRACE("Uncompressed File, no media to ready.\n");
         return ERROR_SUCCESS;
     }
 
@@ -3153,7 +3162,7 @@
             if (file->Attributes & msidbFileAttributesNoncompressed)
             {
                 p = resolve_folder(package, comp->Directory, TRUE, FALSE, NULL);
-                file->SourcePath = build_directory_name(2, p, file->File);
+                file->SourcePath = build_directory_name(2, p, file->ShortName);
                 HeapFree(GetProcessHeap(),0,p);
             }
             else
Index: dlls/msi/action.h
===================================================================
RCS file: /home/wine/wine/dlls/msi/action.h,v
retrieving revision 1.6
diff -u -r1.6 action.h
--- dlls/msi/action.h	16 Mar 2005 11:31:35 -0000	1.6
+++ dlls/msi/action.h	17 May 2005 19:35:35 -0000
@@ -82,6 +82,7 @@
     LPWSTR File;
     INT ComponentIndex;
     LPWSTR FileName;
+    LPWSTR ShortName;
     INT FileSize;
     LPWSTR Version;
     LPWSTR Language;


More information about the wine-patches mailing list