Commit 036f007e authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

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

This (effectively) reverts commit 86bc556f. Signed-off-by: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarHans Leidekker <hans@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent d38076fd
......@@ -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;
......
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment