Commit c788ed85 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

msi: Provide the result of the last action.

parent 1505912c
...@@ -189,7 +189,7 @@ static void ui_actioninfo(MSIPACKAGE *package, LPCWSTR action, BOOL start, ...@@ -189,7 +189,7 @@ static void ui_actioninfo(MSIPACKAGE *package, LPCWSTR action, BOOL start,
if (!row) return; if (!row) return;
MSI_RecordSetStringW(row, 0, message); MSI_RecordSetStringW(row, 0, message);
MSI_RecordSetStringW(row, 1, action); MSI_RecordSetStringW(row, 1, action);
MSI_RecordSetInteger(row, 2, !rc); MSI_RecordSetInteger(row, 2, start ? package->LastActionResult : !rc);
MSI_ProcessMessage(package, INSTALLMESSAGE_INFO, row); MSI_ProcessMessage(package, INSTALLMESSAGE_INFO, row);
msiobj_release(&row->hdr); msiobj_release(&row->hdr);
} }
...@@ -628,6 +628,7 @@ static UINT ACTION_HandleCustomAction(MSIPACKAGE *package, LPCWSTR action, UINT ...@@ -628,6 +628,7 @@ static UINT ACTION_HandleCustomAction(MSIPACKAGE *package, LPCWSTR action, UINT
return ERROR_SUCCESS; return ERROR_SUCCESS;
ui_actioninfo(package, action, FALSE, arc); ui_actioninfo(package, action, FALSE, arc);
package->LastActionResult = !arc;
return arc; return arc;
} }
...@@ -7800,6 +7801,7 @@ static UINT ACTION_HandleStandardAction(MSIPACKAGE *package, LPCWSTR action) ...@@ -7800,6 +7801,7 @@ static UINT ACTION_HandleStandardAction(MSIPACKAGE *package, LPCWSTR action)
ui_actioninfo( package, action, TRUE, 0 ); ui_actioninfo( package, action, TRUE, 0 );
rc = StandardActions[i].handler( package ); rc = StandardActions[i].handler( package );
ui_actioninfo( package, action, FALSE, rc ); ui_actioninfo( package, action, FALSE, rc );
package->LastActionResult = !rc;
if (StandardActions[i].action_rollback && !package->need_rollback) if (StandardActions[i].action_rollback && !package->need_rollback)
{ {
......
...@@ -391,6 +391,7 @@ typedef struct tagMSIPACKAGE ...@@ -391,6 +391,7 @@ typedef struct tagMSIPACKAGE
LPWSTR ActionFormat; LPWSTR ActionFormat;
LPWSTR LastAction; LPWSTR LastAction;
LPWSTR LastActionTemplate; LPWSTR LastActionTemplate;
UINT LastActionResult;
UINT action_progress_increment; UINT action_progress_increment;
HANDLE log_file; HANDLE log_file;
IAssemblyCache *cache_net[CLR_VERSION_MAX]; IAssemblyCache *cache_net[CLR_VERSION_MAX];
......
...@@ -1099,6 +1099,7 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPCWSTR base_url ) ...@@ -1099,6 +1099,7 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPCWSTR base_url )
package->LastAction = NULL; package->LastAction = NULL;
package->LastActionTemplate = NULL; package->LastActionTemplate = NULL;
package->LastActionResult = MSI_NULL_INTEGER;
package->WordCount = 0; package->WordCount = 0;
package->PackagePath = strdupW( db->path ); package->PackagePath = strdupW( db->path );
package->BaseURL = strdupW( base_url ); package->BaseURL = strdupW( base_url );
......
...@@ -9536,7 +9536,7 @@ static void test_externalui_message(void) ...@@ -9536,7 +9536,7 @@ static void test_externalui_message(void)
/* Test a standard action */ /* Test a standard action */
r = MsiDoActionA(hpkg, "CostInitialize"); r = MsiDoActionA(hpkg, "CostInitialize");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); 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 */ /* Test a custom action */
r = MsiDoActionA(hpkg, "custom"); r = MsiDoActionA(hpkg, "custom");
...@@ -9575,7 +9575,7 @@ static void test_externalui_message(void) ...@@ -9575,7 +9575,7 @@ static void test_externalui_message(void)
/* Test a custom action */ /* Test a custom action */
r = MsiDoActionA(hpkg, "custom"); r = MsiDoActionA(hpkg, "custom");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); 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; retval = 0;
r = MsiDoActionA(hpkg, "custom"); r = MsiDoActionA(hpkg, "custom");
...@@ -9584,13 +9584,17 @@ static void test_externalui_message(void) ...@@ -9584,13 +9584,17 @@ static void test_externalui_message(void)
r = MsiDoActionA(hpkg, "dialog"); r = MsiDoActionA(hpkg, "dialog");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); 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; retval = -1;
r = MsiDoActionA(hpkg, "error"); r = MsiDoActionA(hpkg, "error");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok_sequence(doaction_dialog_error_sequence, "MsiDoAction(\"error\")", FALSE); 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); MsiCloseHandle(hpkg);
ok_sequence(closehandle_sequence, "MsiCloseHandle()", FALSE); ok_sequence(closehandle_sequence, "MsiCloseHandle()", FALSE);
......
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