From: Fabian Maurer dark.shadow4@web.de
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56289 --- dlls/msi/dialog.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+)
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index ba8ca526266..6d73a3c3027 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -2500,6 +2500,53 @@ static void seltree_create_imagelist( HWND hwnd ) SendMessageW( hwnd, TVM_SETIMAGELIST, TVSIL_STATE, (LPARAM)himl ); }
+static UINT dialog_find_browse_event( MSIRECORD *rec, void *param ) +{ + msi_dialog *dialog = param; + LPCWSTR condition, event; + UINT r; + + condition = MSI_RecordGetString( rec, 5 ); + r = MSI_EvaluateConditionW( dialog->package, condition ); + if (r == MSICONDITION_TRUE || r == MSICONDITION_NONE) + { + event = MSI_RecordGetString( rec, 3 ); + if (!wcscmp(event, L"SelectionBrowse")) + { + return ERROR_SUCCESS; + } + } + return ERROR_NOT_FOUND; +} + +static void dialog_enable_browse_button( msi_dialog *dialog, BOOL enable ) +{ + MSIQUERY *view; + struct control *control; + UINT r; + + LIST_FOR_EACH_ENTRY( control, &dialog->controls, struct control, entry ) + { + if (wcscmp(control->type, L"PushButton")) + continue; + + r = MSI_OpenQuery( dialog->package->db, &view, + L"SELECT * FROM `ControlEvent` WHERE `Dialog_` = '%s' AND `Control_` = '%s' ORDER BY `Ordering`", + dialog->name, control->name ); + if (r != ERROR_SUCCESS) + { + ERR("query failed\n"); + continue; + } + r = MSI_IterateRecords( view, 0, dialog_find_browse_event, dialog ); + if (r == ERROR_SUCCESS) + { + EnableWindow(control->hwnd, enable); + } + msiobj_release( &view->hdr ); + } +} + static UINT dialog_seltree_handler( msi_dialog *dialog, struct control *control, WPARAM param ) { struct msi_selection_tree_info *info = GetPropW( control->hwnd, L"MSIDATA" ); @@ -2548,6 +2595,7 @@ static UINT dialog_seltree_handler( msi_dialog *dialog, struct control *control, MSI_RecordSetStringW( rec, 1, NULL );
msi_event_fire( dialog->package, L"SelectionPath", rec ); + dialog_enable_browse_button(dialog, dir != NULL);
done: msiobj_release(&row->hdr);
It looks like you're working around the real bug. We shouldn't have to dig into the database at this point.