Hans Leidekker : msi: Fix installing from administrative image with compressed source files.

Alexandre Julliard julliard at winehq.org
Tue Nov 10 13:46:22 CST 2020


Module: wine
Branch: stable
Commit: a652394fc3558559c2c62d4c198a0130ca82fe91
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a652394fc3558559c2c62d4c198a0130ca82fe91

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Wed Jun 10 11:43:39 2020 +0200

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 <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 15c8e5dee6fa3b7eac1d1b3cd6d27aa744faff4d)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/msi/action.c        | 10 +++------
 dlls/msi/tests/install.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+), 7 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 048d5983a9e..bc7fecbd739 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -1223,10 +1223,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;
     }
@@ -1234,10 +1233,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/dlls/msi/tests/install.c b/dlls/msi/tests/install.c
index f7fd83cfc08..39d3efd4aa9 100644
--- a/dlls/msi/tests/install.c
+++ b/dlls/msi/tests/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");




More information about the wine-cvs mailing list