diff --git a/dlls/msi/action.c b/dlls/msi/action.c index fef076f96c5..741e8341ea9 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -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) { diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index bb9d224349d..a3c3c0fabf7 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -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]; diff --git a/dlls/msi/package.c b/dlls/msi/package.c index 7ba7c9a4131..325d212b714 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -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 ); diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c index 4bf1f87f2dc..e15dc579754 100644 --- a/dlls/msi/tests/package.c +++ b/dlls/msi/tests/package.c @@ -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);