Commit d757bfee authored by Alexandre Julliard's avatar Alexandre Julliard

Authors: Aric Stewart <aric@codeweavers.com>, Mike McCormack <mike@codeweavers.com>

Implement dialog events and hook up the dialog code.
parent de832c92
...@@ -16,6 +16,7 @@ C_SRCS = \ ...@@ -16,6 +16,7 @@ C_SRCS = \
delete.c \ delete.c \
dialog.c \ dialog.c \
distinct.c \ distinct.c \
events.c \
format.c \ format.c \
handle.c \ handle.c \
insert.c \ insert.c \
......
...@@ -685,6 +685,21 @@ void ACTION_free_package_structures( MSIPACKAGE* package) ...@@ -685,6 +685,21 @@ void ACTION_free_package_structures( MSIPACKAGE* package)
HeapFree(GetProcessHeap(),0,package->CommitAction); HeapFree(GetProcessHeap(),0,package->CommitAction);
HeapFree(GetProcessHeap(),0,package->PackagePath); HeapFree(GetProcessHeap(),0,package->PackagePath);
/* cleanup control event subscriptions */
ControlEvent_CleanupSubscriptions(package);
}
static void ce_actiontext(MSIPACKAGE* package, LPCWSTR action)
{
static const WCHAR szActionText[] =
{'A','c','t','i','o','n','T','e','x','t',0};
MSIRECORD *row;
row = MSI_CreateRecord(1);
MSI_RecordSetStringW(row,1,action);
ControlEvent_FireSubscribedEvent(package,szActionText, row);
msiobj_release(&row->hdr);
} }
static void ui_progress(MSIPACKAGE *package, int a, int b, int c, int d ) static void ui_progress(MSIPACKAGE *package, int a, int b, int c, int d )
...@@ -714,6 +729,8 @@ static void ui_actiondata(MSIPACKAGE *package, LPCWSTR action, MSIRECORD * recor ...@@ -714,6 +729,8 @@ static void ui_actiondata(MSIPACKAGE *package, LPCWSTR action, MSIRECORD * recor
MSIQUERY * view; MSIQUERY * view;
MSIRECORD * row = 0; MSIRECORD * row = 0;
DWORD size; DWORD size;
static const WCHAR szActionData[] =
{'A','c','t','i','o','n','D','a','t','a',0};
if (!package->LastAction || strcmpW(package->LastAction,action)) if (!package->LastAction || strcmpW(package->LastAction,action))
{ {
...@@ -764,6 +781,9 @@ static void ui_actiondata(MSIPACKAGE *package, LPCWSTR action, MSIRECORD * recor ...@@ -764,6 +781,9 @@ static void ui_actiondata(MSIPACKAGE *package, LPCWSTR action, MSIRECORD * recor
MSI_RecordSetStringW(row,1,message); MSI_RecordSetStringW(row,1,message);
MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, row); MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, row);
ControlEvent_FireSubscribedEvent(package,szActionData, row);
msiobj_release(&row->hdr); msiobj_release(&row->hdr);
} }
...@@ -1403,6 +1423,7 @@ BOOL ACTION_HandleStandardAction(MSIPACKAGE *package, LPCWSTR action, UINT* rc) ...@@ -1403,6 +1423,7 @@ BOOL ACTION_HandleStandardAction(MSIPACKAGE *package, LPCWSTR action, UINT* rc)
{ {
if (strcmpW(StandardActions[i].action, action)==0) if (strcmpW(StandardActions[i].action, action)==0)
{ {
ce_actiontext(package, action);
ui_actioninfo(package, action, TRUE, 0); ui_actioninfo(package, action, TRUE, 0);
ui_actionstart(package, action); ui_actionstart(package, action);
if (StandardActions[i].handler) if (StandardActions[i].handler)
...@@ -1427,15 +1448,11 @@ BOOL ACTION_HandleDialogBox(MSIPACKAGE *package, LPCWSTR dialog, UINT* rc) ...@@ -1427,15 +1448,11 @@ BOOL ACTION_HandleDialogBox(MSIPACKAGE *package, LPCWSTR dialog, UINT* rc)
{ {
BOOL ret = FALSE; BOOL ret = FALSE;
/*
* for the UI when we get that working
*
if (ACTION_DialogBox(package,dialog) == ERROR_SUCCESS) if (ACTION_DialogBox(package,dialog) == ERROR_SUCCESS)
{ {
*rc = package->CurrentInstallState; *rc = package->CurrentInstallState;
ret = TRUE; ret = TRUE;
} }
*/
return ret; return ret;
} }
......
...@@ -196,3 +196,8 @@ int get_loaded_component(MSIPACKAGE* package, LPCWSTR Component ); ...@@ -196,3 +196,8 @@ int get_loaded_component(MSIPACKAGE* package, LPCWSTR Component );
int get_loaded_feature(MSIPACKAGE* package, LPCWSTR Feature ); int get_loaded_feature(MSIPACKAGE* package, LPCWSTR Feature );
int get_loaded_file(MSIPACKAGE* package, LPCWSTR file); int get_loaded_file(MSIPACKAGE* package, LPCWSTR file);
int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path); int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path);
/* control event stuff */
VOID ControlEvent_FireSubscribedEvent(MSIPACKAGE *package, LPCWSTR event,
MSIRECORD *data);
VOID ControlEvent_CleanupSubscriptions(MSIPACKAGE *package);
...@@ -226,6 +226,7 @@ typedef struct tagMSIPACKAGE ...@@ -226,6 +226,7 @@ typedef struct tagMSIPACKAGE
LPWSTR next_dialog; LPWSTR next_dialog;
BOOL ExecuteSequenceRun; BOOL ExecuteSequenceRun;
struct _subscriptions *EventSubscriptions;
} MSIPACKAGE; } MSIPACKAGE;
typedef struct tagMSIPREVIEW typedef struct tagMSIPREVIEW
......
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