[PATCH] Revert "msi: Don't execute a deferred custom action when not running the install script."

Zebediah Figura z.figura12 at gmail.com
Thu Dec 21 01:12:16 CST 2017


This (effectively) reverts commit 86bc556f9fd4a964cbaa66bc1fd67e4603ecd450.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/msi/custom.c        | 19 ++++++++++++++++++-
 dlls/msi/tests/install.c |  1 +
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/dlls/msi/custom.c b/dlls/msi/custom.c
index 2570fe2..f67a7dd 100644
--- a/dlls/msi/custom.c
+++ b/dlls/msi/custom.c
@@ -1132,6 +1132,23 @@ static UINT HANDLE_CustomType53_54( MSIPACKAGE *package, const WCHAR *source, co
     return wait_thread_handle( info );
 }
 
+static BOOL action_type_matches_script( UINT type, UINT script )
+{
+    switch (script)
+    {
+    case SCRIPT_NONE:
+    case SCRIPT_INSTALL:
+        return !(type & msidbCustomActionTypeCommit) && !(type & msidbCustomActionTypeRollback);
+    case SCRIPT_COMMIT:
+        return (type & msidbCustomActionTypeCommit);
+    case SCRIPT_ROLLBACK:
+        return (type & msidbCustomActionTypeRollback);
+    default:
+        ERR("unhandled script %u\n", script);
+    }
+    return FALSE;
+}
+
 static UINT defer_custom_action( MSIPACKAGE *package, const WCHAR *action, UINT type )
 {
     WCHAR *actiondata = msi_dup_property( package->db, action );
@@ -1209,7 +1226,7 @@ UINT ACTION_CustomAction( MSIPACKAGE *package, LPCWSTR action )
         if (type & msidbCustomActionTypeNoImpersonate)
             WARN("msidbCustomActionTypeNoImpersonate not handled\n");
 
-        if (package->script == SCRIPT_NONE)
+        if (!action_type_matches_script( type, package->script ))
         {
             rc = defer_custom_action( package, action, type );
             goto end;
diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c
index 4fedc99..0cc9f9a 100644
--- a/dlls/msi/tests/install.c
+++ b/dlls/msi/tests/install.c
@@ -6056,6 +6056,7 @@ static void test_deferred_action(void)
         skip("Not enough rights to perform tests\n");
         goto error;
     }
+todo_wine
     ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
 
 error:
-- 
2.7.4




More information about the wine-devel mailing list