https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5c7b97165c5fdc6e1cddce1bbe73be1f5647433d

commit 5c7b97165c5fdc6e1cddce1bbe73be1f5647433d
Author:     winesync <[email protected]>
AuthorDate: Sun Mar 13 19:08:35 2022 +0100
Commit:     Mark Jansen <[email protected]>
CommitDate: Sun Mar 20 19:28:28 2022 +0100

    [WINESYNC] msi: Fix installing from administrative image with compressed 
source files.
    
    Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49352
    Signed-off-by: Hans Leidekker <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id 15c8e5dee6fa3b7eac1d1b3cd6d27aa744faff4d by Hans Leidekker 
<[email protected]>
---
 dll/win32/msi/action.c                   | 10 ++----
 modules/rostests/winetests/msi/install.c | 58 ++++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+), 7 deletions(-)

diff --git a/dll/win32/msi/action.c b/dll/win32/msi/action.c
index 8776ac30078..762d734fcbd 100644
--- a/dll/win32/msi/action.c
+++ b/dll/win32/msi/action.c
@@ -1230,10 +1230,9 @@ static UINT load_file(MSIRECORD *row, LPVOID param)
      */
     if (package->WordCount & msidbSumInfoSourceTypeAdminImage)
     {
-        file->IsCompressed = FALSE;
+        file->IsCompressed = package->WordCount & 
msidbSumInfoSourceTypeCompressed;
     }
-    else if (file->Attributes &
-             (msidbFileAttributesCompressed | msidbFileAttributesPatchAdded))
+    else if (file->Attributes & (msidbFileAttributesCompressed | 
msidbFileAttributesPatchAdded))
     {
         file->IsCompressed = TRUE;
     }
@@ -1241,10 +1240,7 @@ static UINT load_file(MSIRECORD *row, LPVOID param)
     {
         file->IsCompressed = FALSE;
     }
-    else
-    {
-        file->IsCompressed = package->WordCount & 
msidbSumInfoSourceTypeCompressed;
-    }
+    else file->IsCompressed = package->WordCount & 
msidbSumInfoSourceTypeCompressed;
 
     load_file_hash(package, file);
     load_file_disk_id(package, file);
diff --git a/modules/rostests/winetests/msi/install.c 
b/modules/rostests/winetests/msi/install.c
index 99d53e56570..2cfa810e1da 100644
--- a/modules/rostests/winetests/msi/install.c
+++ b/modules/rostests/winetests/msi/install.c
@@ -1392,6 +1392,34 @@ static const CHAR sr_custom_action_dat[] =
     "sourcedir_unset\t19\t\tSourceDir should not be set\n"
     "sourcedir_set\t19\t\tSourceDir should be set\n";
 
+static const CHAR ai2_file_dat[] =
+    
"File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
+    "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
+    "File\tFile\n"
+    "five.txt\tFive\tfive.txt\t1000\t\t\t0\t5\n"
+    "four.txt\tFour\tfour.txt\t1000\t\t\t0\t4\n";
+
+static const CHAR ai2_component_dat[] =
+    "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
+    "s72\tS38\ts72\ti2\tS255\tS72\n"
+    "Component\tComponent\n"
+    "Five\t{8CC92E9D-14B2-4CA4-B2AA-B11D02078087}\tNEWDIR\t2\t\tfive.txt\n"
+    "Four\t{FD37B4EA-7209-45C0-8917-535F35A2F080}\tCABOUTDIR\t2\t\tfour.txt\n";
+
+static const CHAR ai2_feature_dat[] =
+    
"Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
+    "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
+    "Feature\tFeature\n"
+    "Five\t\tFive\tThe Five Feature\t5\t3\tNEWDIR\t0\n"
+    "Four\t\tFour\tThe Four Feature\t4\t3\tCABOUTDIR\t0\n";
+
+static const CHAR ai2_feature_comp_dat[] =
+    "Feature_\tComponent_\n"
+    "s38\ts72\n"
+    "FeatureComponents\tFeature_\tComponent_\n"
+    "Five\tFive\n"
+    "Four\tFour\n";
+
 static const msi_table tables[] =
 {
     ADD_TABLE(component),
@@ -1821,6 +1849,18 @@ static const msi_table ai_tables[] =
     ADD_TABLE(property)
 };
 
+static const msi_table ai2_tables[] =
+{
+    ADD_TABLE(ai2_component),
+    ADD_TABLE(directory),
+    ADD_TABLE(ai2_feature),
+    ADD_TABLE(ai2_feature_comp),
+    ADD_TABLE(ai2_file),
+    ADD_TABLE(install_exec_seq),
+    ADD_TABLE(media),
+    ADD_TABLE(property)
+};
+
 static const msi_table pc_tables[] =
 {
     ADD_TABLE(ca51_component),
@@ -4865,6 +4905,24 @@ static void test_adminimage(void)
 
     delete_pf_files();
 
+    create_file("four.txt", 100);
+    create_file("five.txt", 100);
+    create_cab_file("msitest.cab", MEDIA_SIZE, "four.txt\0five.txt\0");
+    create_database_wordcount(msifile, ai2_tables, ARRAY_SIZE(ai2_tables),
+                              100, 
msidbSumInfoSourceTypeAdminImage|msidbSumInfoSourceTypeCompressed,
+                              ";1033", 
"{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
+
+    MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
+
+    r = MsiInstallProductA(msifile, NULL);
+    ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
+
+    ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not 
installed\n");
+    ok(delete_pf("msitest\\cabout\\new", FALSE), "Directory not created\n");
+    ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
+    ok(delete_pf("msitest\\cabout", FALSE), "Directory not created\n");
+    ok(delete_pf("msitest", FALSE), "Directory not created\n");
+
 error:
     DeleteFileA("msifile");
     DeleteFileA("msitest\\cabout\\new\\five.txt");

Reply via email to