msi: Conformance test, check that INSTALLUILEVEL flags don't trigger UI install. [updated 2]

Misha Koshelev mk144210 at bcm.tmc.edu
Thu Feb 8 19:25:51 CST 2007


Update: Changed according to James Hawkins comments.

Thanks to James Hawkins for numerous emails and help. This patch is a
conformance test that tickles bug #6992 which is now fixed, where MSI
was comparing whether the UI level requested was greater than or equal
to a certain value to determine whether or not to do a graphical
install, but was ignoring the fact that flags could be set in the higher
bits that should not affect the UI level, and this, in turn, caused a
problem with the Vector NTI installer. This conformance test makes an
MSI with three files, one that is always created (this is a check for
installer working), one that is created only in full UI install (thus
the function can know that a full UI install occurred), and one that is
never created (I guess this would be making sure that the installer is
not completely ignoring conditions for file installation). It then
installs it, checks which ones were created, and gives the user
appropriate, verbose error messages.

I tested this conformance test and it is able to detect a UI versus
execute-only install in wine and in VMWared WinXP and Win98. It
successfully passes in its final form on all three platforms, and fails
if I revert the Wine behavior so that it does not take INSTALLUILEVEL
flags into account, telling the user that a full UI install occurred 
even though only an execute one was requested.

Changelog:

        * msi: Conformance test, check that INSTALLUILEVEL flags don't
trigger UI install.

-------------- next part --------------
From 427639440e3bd1fd8569cfcb827db3055a1d6275 Mon Sep 17 00:00:00 2001
From: Misha Koshelev <mk144210 at bcm.tmc.edu>
Date: Thu, 8 Feb 2007 19:23:31 -0600
Subject: msi: Conformance test, check that INSTALLUILEVEL flags don't trigger UI install.
---
 dlls/msi/tests/install.c |   58 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 58 insertions(+), 0 deletions(-)

diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c
index 7a8412b..180c743 100644
--- a/dlls/msi/tests/install.c
+++ b/dlls/msi/tests/install.c
@@ -115,6 +115,7 @@ static const CHAR property_dat[] = "Prop
                                    "s72\tl0\n"
                                    "Property\tProperty\n"
                                    "DefaultUIFont\tDlgFont8\n"
+                                   "HASUIRUN\t0\n"
                                    "INSTALLLEVEL\t3\n"
                                    "InstallMode\tTypical\n"
                                    "Manufacturer\tWine\n"
@@ -221,6 +222,25 @@ static const CHAR ss_media_dat[] = "Disk
                                    "2\t2\t\ttest2.cab\tDISK2\t\n"
                                    "3\t12\t\ttest3.cab\tDISK3\t\n";
 
+/* tables for test_uiLevelFlags */
+static const CHAR ui_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
+                                       "s72\tS38\ts72\ti2\tS255\tS72\n"
+                                       "Component\tComponent\n"
+                                       "maximus\t\tMSITESTDIR\t0\tHASUIRUN=1\tmaximus\n"
+                                       "augustus\t\tMSITESTDIR\t0\t1\taugustus\n"
+                                       "caesar\t\tMSITESTDIR\t0\t1\tcaesar\n";
+
+static const CHAR ui_install_ui_seq_dat[] = "Action\tCondition\tSequence\n"
+                                           "s72\tS255\tI2\n"
+                                           "InstallUISequence\tAction\n"
+                                           "SetUIProperty\t\t5\n"
+                                           "ExecuteAction\t\t1100\n";
+
+static const CHAR ui_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
+                                           "s72\ti2\tS64\tS0\tS255\n"
+                                           "CustomAction\tAction\n" 
+                                           "SetUIProperty\t51\tHASUIRUN\t1\t\n";
+
 typedef struct _msi_table
 {
     const CHAR *filename;
@@ -305,6 +325,20 @@ static const msi_table ss_tables[] =
     ADD_TABLE(property),
 };
 
+static const msi_table ui_tables[] =
+{
+    ADD_TABLE(ui_component),
+    ADD_TABLE(directory),
+    ADD_TABLE(cc_feature),
+    ADD_TABLE(cc_feature_comp),
+    ADD_TABLE(cc_file),
+    ADD_TABLE(install_exec_seq),
+    ADD_TABLE(ui_install_ui_seq),
+    ADD_TABLE(ui_custom_action),
+    ADD_TABLE(cc_media),
+    ADD_TABLE(property),
+};
+
 /* cabinet definitions */
 
 /* make the max size large so there is only one cab file */
@@ -1063,6 +1097,29 @@ static void test_samesequence(void)
     DeleteFile(msifile);
 }
 
+static void test_uiLevelFlags(void)
+{
+    UINT r;
+
+    create_cc_test_files();
+    create_database(msifile, ui_tables, sizeof(ui_tables) / sizeof(msi_table));
+
+    MsiSetInternalUI(INSTALLUILEVEL_NONE | INSTALLUILEVEL_SOURCERESONLY, NULL);
+
+    r = MsiInstallProductA(msifile, NULL);
+    ok(!delete_pf("msitest\\maximus", TRUE), "UI install occurred, but execute-only was requested.\n");
+    todo_wine
+    {
+        ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
+        ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
+        ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
+    }
+    delete_pf("msitest", FALSE);
+
+    delete_cab_files();
+    DeleteFile(msifile);
+}
+
 START_TEST(install)
 {
     DWORD len;
@@ -1087,6 +1144,7 @@ START_TEST(install)
     test_caborder();
     test_mixedmedia();
     test_samesequence();
+    test_uiLevelFlags();
 
     SetCurrentDirectoryA(prev_path);
 }
-- 
1.4.1



More information about the wine-patches mailing list