Module: wine Branch: master Commit: 036f007e241b95498964c53365300a3332a92c5a URL: https://source.winehq.org/git/wine.git/?a=commit;h=036f007e241b95498964c5336...
Author: Zebediah Figura z.figura12@gmail.com Date: Thu Dec 21 01:12:16 2017 -0600
Revert "msi: Don't execute a deferred custom action when not running the install script.".
This (effectively) reverts commit 86bc556f9fd4a964cbaa66bc1fd67e4603ecd450.
Signed-off-by: Zebediah Figura z.figura12@gmail.com Signed-off-by: Hans Leidekker hans@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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 39980be..acbf162 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -5934,6 +5934,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: