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

This (effectively) reverts commit 86bc556f9f.

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>
This commit is contained in:
Zebediah Figura 2017-12-21 01:12:16 -06:00 committed by Alexandre Julliard
parent d38076fd57
commit 036f007e24
2 changed files with 19 additions and 1 deletions

View File

@ -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;

View File

@ -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: