Module: wine Branch: master Commit: ad971803daeb9057626982f9cfe47eefbb14227b URL: http://source.winehq.org/git/wine.git/?a=commit;h=ad971803daeb9057626982f9cf...
Author: Hans Leidekker hans@codeweavers.com Date: Fri Jul 23 09:42:21 2010 +0200
msi: Never defer standard actions.
---
dlls/msi/action.c | 54 ++++++++++++++++----------------------------------- dlls/msi/events.c | 2 +- dlls/msi/msipriv.h | 2 +- 3 files changed, 19 insertions(+), 39 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 29071d0..40f376a 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -814,7 +814,7 @@ static UINT ITERATE_Actions(MSIRECORD *row, LPVOID param) if (needs_ui_sequence(package)) rc = ACTION_PerformUIAction(package, action, -1); else - rc = ACTION_PerformAction(package, action, -1, FALSE); + rc = ACTION_PerformAction(package, action, -1);
msi_dialog_check_messages( NULL );
@@ -1618,7 +1618,7 @@ static UINT execute_script(MSIPACKAGE *package, UINT script ) action = package->script->Actions[script][i]; ui_actionstart(package, action); TRACE("Executing Action (%s)\n",debugstr_w(action)); - rc = ACTION_PerformAction(package, action, script, TRUE); + rc = ACTION_PerformAction(package, action, script); if (rc != ERROR_SUCCESS) break; } @@ -7319,47 +7319,27 @@ StandardActions[] = { NULL, NULL }, };
-static BOOL ACTION_HandleStandardAction(MSIPACKAGE *package, LPCWSTR action, - UINT* rc, BOOL force ) +static BOOL ACTION_HandleStandardAction( MSIPACKAGE *package, LPCWSTR action, UINT *rc ) { BOOL ret = FALSE; - BOOL run = force; - int i; - - if (!run && !package->script->CurrentlyScripting) - run = TRUE; - - if (!run) - { - if (strcmpW(action,szInstallFinalize) == 0 || - strcmpW(action,szInstallExecute) == 0 || - strcmpW(action,szInstallExecuteAgain) == 0) - run = TRUE; - } + UINT i;
i = 0; while (StandardActions[i].action != NULL) { - if (strcmpW(StandardActions[i].action, action)==0) + if (!strcmpW( StandardActions[i].action, action )) { - if (!run) + ui_actionstart( package, action ); + if (StandardActions[i].handler) { - ui_actioninfo(package, action, TRUE, 0); - *rc = schedule_action(package,INSTALL_SCRIPT,action); - ui_actioninfo(package, action, FALSE, *rc); + ui_actioninfo( package, action, TRUE, 0 ); + *rc = StandardActions[i].handler( package ); + ui_actioninfo( package, action, FALSE, *rc ); } else { - ui_actionstart(package, action); - if (StandardActions[i].handler) - { - *rc = StandardActions[i].handler(package); - } - else - { - FIXME("unhandled standard action %s\n",debugstr_w(action)); - *rc = ERROR_SUCCESS; - } + FIXME("unhandled standard action %s\n", debugstr_w(action)); + *rc = ERROR_SUCCESS; } ret = TRUE; break; @@ -7369,17 +7349,17 @@ static BOOL ACTION_HandleStandardAction(MSIPACKAGE *package, LPCWSTR action, return ret; }
-UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, UINT script, BOOL force) +UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, UINT script) { UINT rc = ERROR_SUCCESS; BOOL handled;
TRACE("Performing action (%s)\n", debugstr_w(action));
- handled = ACTION_HandleStandardAction(package, action, &rc, force); + handled = ACTION_HandleStandardAction(package, action, &rc);
if (!handled) - handled = ACTION_HandleCustomAction(package, action, &rc, script, force); + handled = ACTION_HandleCustomAction(package, action, &rc, script, TRUE);
if (!handled) { @@ -7397,7 +7377,7 @@ UINT ACTION_PerformUIAction(MSIPACKAGE *package, const WCHAR *action, UINT scrip
TRACE("Performing action (%s)\n", debugstr_w(action));
- handled = ACTION_HandleStandardAction(package, action, &rc,TRUE); + handled = ACTION_HandleStandardAction(package, action, &rc);
if (!handled) handled = ACTION_HandleCustomAction(package, action, &rc, script, FALSE); @@ -7462,7 +7442,7 @@ static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq) if (needs_ui_sequence(package)) rc = ACTION_PerformUIAction(package, action, -1); else - rc = ACTION_PerformAction(package, action, -1, FALSE); + rc = ACTION_PerformAction(package, action, -1);
msiobj_release(&row->hdr); } diff --git a/dlls/msi/events.c b/dlls/msi/events.c index 4ed395b..157d185 100644 --- a/dlls/msi/events.c +++ b/dlls/msi/events.c @@ -163,7 +163,7 @@ static UINT ControlEvent_SpawnWaitDialog(MSIPACKAGE* package, LPCWSTR argument, static UINT ControlEvent_DoAction(MSIPACKAGE* package, LPCWSTR argument, msi_dialog* dialog) { - ACTION_PerformAction(package,argument,-1,TRUE); + ACTION_PerformAction(package, argument, -1); return ERROR_SUCCESS; }
diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index 0be3eb9..c9b7bc7 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -865,7 +865,7 @@ extern WCHAR gszLogFile[MAX_PATH]; extern HINSTANCE msi_hInstance;
/* action related functions */ -extern UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, UINT script, BOOL force); +extern UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, UINT script); extern UINT ACTION_PerformUIAction(MSIPACKAGE *package, const WCHAR *action, UINT script); extern void ACTION_FinishCustomActions( const MSIPACKAGE* package); extern UINT ACTION_CustomAction(MSIPACKAGE *package,const WCHAR *action, UINT script, BOOL execute);