Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
71a55e04
Commit
71a55e04
authored
Jun 17, 2005
by
Aric Stewart
Committed by
Alexandre Julliard
Jun 17, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow control events to return codes to halt the processing of event.
Needed for the SetTargetPath Event.
parent
a1f4fac0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
17 deletions
+35
-17
events.c
dlls/msi/events.c
+32
-15
msipriv.h
dlls/msi/msipriv.h
+1
-1
preview.c
dlls/msi/preview.c
+2
-1
No files found.
dlls/msi/events.c
View file @
71a55e04
...
...
@@ -38,7 +38,7 @@ http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/contr
WINE_DEFAULT_DEBUG_CHANNEL
(
msi
);
typedef
void
(
*
EVENTHANDLER
)(
MSIPACKAGE
*
,
LPCWSTR
,
msi_dialog
*
);
typedef
UINT
(
*
EVENTHANDLER
)(
MSIPACKAGE
*
,
LPCWSTR
,
msi_dialog
*
);
struct
_events
{
LPCSTR
event
;
...
...
@@ -52,7 +52,7 @@ struct subscriber {
LPWSTR
attribute
;
};
VOID
ControlEvent_HandleControlEvent
(
MSIPACKAGE
*
,
LPCWSTR
,
LPCWSTR
,
msi_dialog
*
);
UINT
ControlEvent_HandleControlEvent
(
MSIPACKAGE
*
,
LPCWSTR
,
LPCWSTR
,
msi_dialog
*
);
/*
* Create a dialog box and run it if it's modal
...
...
@@ -89,7 +89,7 @@ static UINT event_do_dialog( MSIPACKAGE *package, LPCWSTR name )
/*
* End a modal dialog box
*/
static
VOID
ControlEvent_EndDialog
(
MSIPACKAGE
*
package
,
LPCWSTR
argument
,
static
UINT
ControlEvent_EndDialog
(
MSIPACKAGE
*
package
,
LPCWSTR
argument
,
msi_dialog
*
dialog
)
{
static
const
WCHAR
szExit
[]
=
{
...
...
@@ -117,48 +117,53 @@ static VOID ControlEvent_EndDialog(MSIPACKAGE* package, LPCWSTR argument,
ControlEvent_CleanupSubscriptions
(
package
);
msi_dialog_end_dialog
(
dialog
);
return
ERROR_SUCCESS
;
}
/*
* transition from one modal dialog to another modal dialog
*/
static
VOID
ControlEvent_NewDialog
(
MSIPACKAGE
*
package
,
LPCWSTR
argument
,
static
UINT
ControlEvent_NewDialog
(
MSIPACKAGE
*
package
,
LPCWSTR
argument
,
msi_dialog
*
dialog
)
{
/* store the name of the next dialog, and signal this one to end */
package
->
next_dialog
=
strdupW
(
argument
);
ControlEvent_CleanupSubscriptions
(
package
);
msi_dialog_end_dialog
(
dialog
);
return
ERROR_SUCCESS
;
}
/*
* Create a new child dialog of an existing modal dialog
*/
static
VOID
ControlEvent_SpawnDialog
(
MSIPACKAGE
*
package
,
LPCWSTR
argument
,
static
UINT
ControlEvent_SpawnDialog
(
MSIPACKAGE
*
package
,
LPCWSTR
argument
,
msi_dialog
*
dialog
)
{
event_do_dialog
(
package
,
argument
);
if
(
package
->
CurrentInstallState
!=
ERROR_SUCCESS
)
msi_dialog_end_dialog
(
dialog
);
return
ERROR_SUCCESS
;
}
/*
* Creates a dialog that remains up for a period of time
* based on a condition
*/
static
VOID
ControlEvent_SpawnWaitDialog
(
MSIPACKAGE
*
package
,
LPCWSTR
argument
,
static
UINT
ControlEvent_SpawnWaitDialog
(
MSIPACKAGE
*
package
,
LPCWSTR
argument
,
msi_dialog
*
dialog
)
{
FIXME
(
"Doing Nothing
\n
"
);
return
ERROR_SUCCESS
;
}
static
VOID
ControlEvent_DoAction
(
MSIPACKAGE
*
package
,
LPCWSTR
argument
,
static
UINT
ControlEvent_DoAction
(
MSIPACKAGE
*
package
,
LPCWSTR
argument
,
msi_dialog
*
dialog
)
{
ACTION_PerformAction
(
package
,
argument
,
TRUE
);
return
ERROR_SUCCESS
;
}
static
VOID
ControlEvent_AddLocal
(
MSIPACKAGE
*
package
,
LPCWSTR
argument
,
static
UINT
ControlEvent_AddLocal
(
MSIPACKAGE
*
package
,
LPCWSTR
argument
,
msi_dialog
*
dialog
)
{
static
const
WCHAR
szAll
[]
=
{
'A'
,
'L'
,
'L'
,
0
};
...
...
@@ -177,10 +182,10 @@ static VOID ControlEvent_AddLocal(MSIPACKAGE* package, LPCWSTR argument,
}
ACTION_UpdateComponentStates
(
package
,
argument
);
}
return
ERROR_SUCCESS
;
}
static
VOID
ControlEvent_Remove
(
MSIPACKAGE
*
package
,
LPCWSTR
argument
,
static
UINT
ControlEvent_Remove
(
MSIPACKAGE
*
package
,
LPCWSTR
argument
,
msi_dialog
*
dialog
)
{
static
const
WCHAR
szAll
[]
=
{
'A'
,
'L'
,
'L'
,
0
};
...
...
@@ -199,9 +204,10 @@ static VOID ControlEvent_Remove(MSIPACKAGE* package, LPCWSTR argument,
}
ACTION_UpdateComponentStates
(
package
,
argument
);
}
return
ERROR_SUCCESS
;
}
static
VOID
ControlEvent_AddSource
(
MSIPACKAGE
*
package
,
LPCWSTR
argument
,
static
UINT
ControlEvent_AddSource
(
MSIPACKAGE
*
package
,
LPCWSTR
argument
,
msi_dialog
*
dialog
)
{
static
const
WCHAR
szAll
[]
=
{
'A'
,
'L'
,
'L'
,
0
};
...
...
@@ -220,8 +226,16 @@ static VOID ControlEvent_AddSource(MSIPACKAGE* package, LPCWSTR argument,
}
ACTION_UpdateComponentStates
(
package
,
argument
);
}
return
ERROR_SUCCESS
;
}
static
UINT
ControlEvent_SetTargetPath
(
MSIPACKAGE
*
package
,
LPCWSTR
argument
,
msi_dialog
*
dialog
)
{
LPWSTR
path
=
load_dynamic_property
(
package
,
argument
,
NULL
);
/* failure to set the path halts the executing of control events */
return
MSI_SetTargetPathW
(
package
,
argument
,
path
);
}
/*
* Subscribed events
...
...
@@ -350,17 +364,19 @@ struct _events Events[] = {
{
"AddLocal"
,
ControlEvent_AddLocal
},
{
"Remove"
,
ControlEvent_Remove
},
{
"AddSource"
,
ControlEvent_AddSource
},
{
"SetTargetPath"
,
ControlEvent_SetTargetPath
},
{
NULL
,
NULL
},
};
VOID
ControlEvent_HandleControlEvent
(
MSIPACKAGE
*
package
,
LPCWSTR
event
,
UINT
ControlEvent_HandleControlEvent
(
MSIPACKAGE
*
package
,
LPCWSTR
event
,
LPCWSTR
argument
,
msi_dialog
*
dialog
)
{
int
i
=
0
;
UINT
rc
=
ERROR_SUCCESS
;
TRACE
(
"Handling Control Event %s
\n
"
,
debugstr_w
(
event
));
if
(
!
event
)
return
;
return
rc
;
while
(
Events
[
i
].
event
!=
NULL
)
{
...
...
@@ -368,12 +384,13 @@ VOID ControlEvent_HandleControlEvent(MSIPACKAGE *package, LPCWSTR event,
if
(
lstrcmpW
(
wevent
,
event
)
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
wevent
);
Events
[
i
].
handler
(
package
,
argument
,
dialog
);
return
;
rc
=
Events
[
i
].
handler
(
package
,
argument
,
dialog
);
return
rc
;
}
HeapFree
(
GetProcessHeap
(),
0
,
wevent
);
i
++
;
}
FIXME
(
"unhandled control event %s arg(%s)
\n
"
,
debugstr_w
(
event
),
debugstr_w
(
argument
));
return
rc
;
}
dlls/msi/msipriv.h
View file @
71a55e04
...
...
@@ -387,7 +387,7 @@ extern UINT MSIREG_OpenUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create
extern
UINT
MSIREG_OpenUserUpgradeCodesKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
);
/* msi dialog interface */
typedef
VOID
(
*
msi_dialog_event_handler
)(
MSIPACKAGE
*
,
LPCWSTR
,
LPCWSTR
,
msi_dialog
*
);
typedef
UINT
(
*
msi_dialog_event_handler
)(
MSIPACKAGE
*
,
LPCWSTR
,
LPCWSTR
,
msi_dialog
*
);
extern
msi_dialog
*
msi_dialog_create
(
MSIPACKAGE
*
,
LPCWSTR
,
msi_dialog_event_handler
);
extern
UINT
msi_dialog_run_message_loop
(
msi_dialog
*
);
extern
void
msi_dialog_end_dialog
(
msi_dialog
*
);
...
...
dlls/msi/preview.c
View file @
71a55e04
...
...
@@ -82,11 +82,12 @@ UINT WINAPI MsiEnableUIPreview( MSIHANDLE hdb, MSIHANDLE* phPreview )
return
r
;
}
static
VOID
preview_event_handler
(
MSIPACKAGE
*
package
,
LPCWSTR
event
,
static
UINT
preview_event_handler
(
MSIPACKAGE
*
package
,
LPCWSTR
event
,
LPCWSTR
argument
,
msi_dialog
*
dialog
)
{
MESSAGE
(
"Preview dialog event '%s' (arg='%s')
\n
"
,
debugstr_w
(
event
),
debugstr_w
(
argument
));
return
ERROR_SUCCESS
;
}
UINT
MSI_PreviewDialogW
(
MSIPREVIEW
*
preview
,
LPCWSTR
szDialogName
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment