msi: Provide the result of the last action.

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-07-07 09:03:14 -05:00 committed by Alexandre Julliard
parent 1505912ce1
commit c788ed858e
4 changed files with 12 additions and 4 deletions

View file

@ -189,7 +189,7 @@ static void ui_actioninfo(MSIPACKAGE *package, LPCWSTR action, BOOL start,
if (!row) return;
MSI_RecordSetStringW(row, 0, message);
MSI_RecordSetStringW(row, 1, action);
MSI_RecordSetInteger(row, 2, !rc);
MSI_RecordSetInteger(row, 2, start ? package->LastActionResult : !rc);
MSI_ProcessMessage(package, INSTALLMESSAGE_INFO, row);
msiobj_release(&row->hdr);
}
@ -628,6 +628,7 @@ static UINT ACTION_HandleCustomAction(MSIPACKAGE *package, LPCWSTR action, UINT
return ERROR_SUCCESS;
ui_actioninfo(package, action, FALSE, arc);
package->LastActionResult = !arc;
return arc;
}
@ -7800,6 +7801,7 @@ static UINT ACTION_HandleStandardAction(MSIPACKAGE *package, LPCWSTR action)
ui_actioninfo( package, action, TRUE, 0 );
rc = StandardActions[i].handler( package );
ui_actioninfo( package, action, FALSE, rc );
package->LastActionResult = !rc;
if (StandardActions[i].action_rollback && !package->need_rollback)
{

View file

@ -391,6 +391,7 @@ typedef struct tagMSIPACKAGE
LPWSTR ActionFormat;
LPWSTR LastAction;
LPWSTR LastActionTemplate;
UINT LastActionResult;
UINT action_progress_increment;
HANDLE log_file;
IAssemblyCache *cache_net[CLR_VERSION_MAX];

View file

@ -1099,6 +1099,7 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPCWSTR base_url )
package->LastAction = NULL;
package->LastActionTemplate = NULL;
package->LastActionResult = MSI_NULL_INTEGER;
package->WordCount = 0;
package->PackagePath = strdupW( db->path );
package->BaseURL = strdupW( base_url );

View file

@ -9536,7 +9536,7 @@ static void test_externalui_message(void)
/* Test a standard action */
r = MsiDoActionA(hpkg, "CostInitialize");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok_sequence(doaction_costinitialize_sequence, "MsiDoAction(\"CostInitialize\")", TRUE);
ok_sequence(doaction_costinitialize_sequence, "MsiDoAction(\"CostInitialize\")", FALSE);
/* Test a custom action */
r = MsiDoActionA(hpkg, "custom");
@ -9575,7 +9575,7 @@ static void test_externalui_message(void)
/* Test a custom action */
r = MsiDoActionA(hpkg, "custom");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok_sequence(doaction_custom_fullui_sequence, "MsiDoAction(\"custom\")", TRUE);
ok_sequence(doaction_custom_fullui_sequence, "MsiDoAction(\"custom\")", FALSE);
retval = 0;
r = MsiDoActionA(hpkg, "custom");
@ -9584,13 +9584,17 @@ static void test_externalui_message(void)
r = MsiDoActionA(hpkg, "dialog");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok_sequence(doaction_dialog_sequence, "MsiDoAction(\"dialog\")", TRUE);
ok_sequence(doaction_dialog_sequence, "MsiDoAction(\"dialog\")", FALSE);
retval = -1;
r = MsiDoActionA(hpkg, "error");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok_sequence(doaction_dialog_error_sequence, "MsiDoAction(\"error\")", FALSE);
r = MsiDoActionA(hpkg, "error");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok_sequence(doaction_dialog_error_sequence, "MsiDoAction(\"error\")", FALSE);
MsiCloseHandle(hpkg);
ok_sequence(closehandle_sequence, "MsiCloseHandle()", FALSE);