[PATCH 0/1] MR11017: msi: Catch all exceptions in the custom DLL procedure.
From: Dmitry Timoshkov <dmitry@baikal.ru> Wine-Bug: http://bugs.winehq.org/show_bug.cgi?id=50583 Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru> --- dlls/msi/custom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/msi/custom.c b/dlls/msi/custom.c index cee8e06981c..ab25d1e848c 100644 --- a/dlls/msi/custom.c +++ b/dlls/msi/custom.c @@ -553,9 +553,9 @@ UINT CDECL __wine_msi_call_dll_function(DWORD client_pid, const GUID *guid) { r = custom_proc_wrapper( fn, hPackage ); } - __EXCEPT_PAGE_FAULT + __EXCEPT_ALL { - ERR( "Custom action (%s:%s) caused a page fault: %#lx\n", + ERR( "Custom action (%s:%s) caused an exception: %#lx\n", debugstr_w(dll), debugstr_a(proc), GetExceptionCode() ); r = ERROR_SUCCESS; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11017
Hans Leidekker (@hans) commented about dlls/msi/custom.c:
{ r = custom_proc_wrapper( fn, hPackage ); } - __EXCEPT_PAGE_FAULT + __EXCEPT_ALL { - ERR( "Custom action (%s:%s) caused a page fault: %#lx\n", + ERR( "Custom action (%s:%s) caused an exception: %#lx\n", debugstr_w(dll), debugstr_a(proc), GetExceptionCode() ); r = ERROR_SUCCESS;
A quick test shows that we should return ERROR_INSTALL_FAILURE for exceptions. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11017#note_141640
On Fri May 29 08:00:34 2026 +0000, Hans Leidekker wrote:
A quick test shows that we should return ERROR_INSTALL_FAILURE for exceptions. That should probably be a separate change. I tested the installer from the bug 58623 and it always generates an exception in the SetStartMenuWindows10T custom action under Wine and Windows, but the installer doesn't fail.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/11017#note_141642
On Fri May 29 08:09:26 2026 +0000, Dmitry Timoshkov wrote:
That should probably be a separate change. I tested the installer from the bug 58623 and it always generates an exception in the SetStartMenuWindows10T custom action under Wine and Windows, but the installer doesn't fail. That might mean the failure is ignored (e.g. if the action is marked msidbCustomActionTypeContinue) but we don't want to return success for an exception if Windows doesn't do that.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/11017#note_141644
On Fri May 29 08:20:23 2026 +0000, Hans Leidekker wrote:
That might mean the failure is ignored (e.g. if the action is marked msidbCustomActionTypeContinue) but we don't want to return success for an exception if Windows doesn't do that. Both the installers from bugs 50583 and 58623 successfully finish when ERROR_INSTALL_FAILURE is returned. What would you suggest, add it as a separate patch, or make it as part of an existing one?
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/11017#note_141645
On Fri May 29 08:43:54 2026 +0000, Dmitry Timoshkov wrote:
Both the installers from bugs 50583 and 58623 successfully finish when ERROR_INSTALL_FAILURE is returned. What would you suggest, add it as a separate patch, or make it as part of an existing one? I think it should be a patch before this one and it should have a test. We should also check if a page fault is handled the same.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/11017#note_141646
Attached tests [0002-msi-tests-Add-tests-for-exceptions-in-custom-actions.patch](/uploads/e6295bec9ff55d2cf22f2fb14898bf17/0002-msi-tests-Add-tests-for-exceptions-in-custom-actions.patch) fail under Windows with ERROR_INSTALL_FAILURE: https://testbot.winehq.org/JobDetails.pl?Key=163160 even with msidbCustomActionTypeContinue. Do I miss something? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11017#note_141658
Looks good, thanks. Not sure about msidbCustomActionTypeContinue but here it's sufficient to know that the action fails. Please combine the test tables. You can use a condition variable in InstallExecuteSequence to select the custom action: ``` "page_fault\tPAGEFAULT AND NOT REMOVE\t601\n" "raise_exception\tEXCEPTION AND NOT REMOVE\t602\n" ``` And then install like this: ``` r = MsiInstallProductA(msifile, "PAGEFAULT=1"); ``` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11017#note_141666
participants (3)
-
Dmitry Timoshkov -
Dmitry Timoshkov (@dmitry) -
Hans Leidekker (@hans)