Skip to content

Commit 0d762dc

Browse files
winesynclearn-more
authored andcommitted
[WINESYNC] msi: Store the current script in the package.
Signed-off-by: Zebediah Figura <[email protected]> Signed-off-by: Hans Leidekker <[email protected]> Signed-off-by: Alexandre Julliard <[email protected]> wine commit id 756bbb5bb756d1fcbeea41e10a6fdf2149fa1323 by Zebediah Figura <[email protected]>
1 parent 19863c8 commit 0d762dc

File tree

7 files changed

+26
-19
lines changed

7 files changed

+26
-19
lines changed

dll/win32/msi/action.c

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ static UINT ITERATE_Actions(MSIRECORD *row, LPVOID param)
517517
return ERROR_SUCCESS;
518518
}
519519

520-
rc = ACTION_PerformAction(package, action, SCRIPT_NONE);
520+
rc = ACTION_PerformAction(package, action);
521521

522522
msi_dialog_check_messages( NULL );
523523

@@ -611,7 +611,7 @@ static UINT ACTION_ProcessUISequence(MSIPACKAGE *package)
611611
/********************************************************
612612
* ACTION helper functions and functions that perform the actions
613613
*******************************************************/
614-
static UINT ACTION_HandleCustomAction(MSIPACKAGE *package, LPCWSTR action, UINT script)
614+
static UINT ACTION_HandleCustomAction(MSIPACKAGE *package, LPCWSTR action)
615615
{
616616
UINT arc;
617617
INT uirc;
@@ -620,7 +620,7 @@ static UINT ACTION_HandleCustomAction(MSIPACKAGE *package, LPCWSTR action, UINT
620620
if (uirc == IDCANCEL)
621621
return ERROR_INSTALL_USEREXIT;
622622
ui_actioninfo(package, action, TRUE, 0);
623-
arc = ACTION_CustomAction( package, action, script );
623+
arc = ACTION_CustomAction(package, action);
624624
uirc = !arc;
625625

626626
if (arc == ERROR_FUNCTION_NOT_CALLED && needs_ui_sequence(package))
@@ -1553,11 +1553,13 @@ static UINT execute_script( MSIPACKAGE *package, UINT script )
15531553

15541554
TRACE("executing script %u\n", script);
15551555

1556+
package->script = script;
1557+
15561558
if (script == SCRIPT_ROLLBACK)
15571559
{
15581560
for (i = package->script_actions_count[script]; i > 0; i--)
15591561
{
1560-
rc = ACTION_PerformAction(package, package->script_actions[script][i-1], script);
1562+
rc = ACTION_PerformAction(package, package->script_actions[script][i-1]);
15611563
if (rc != ERROR_SUCCESS)
15621564
{
15631565
ERR("Execution of script %i halted; action %s returned %u\n",
@@ -1570,7 +1572,7 @@ static UINT execute_script( MSIPACKAGE *package, UINT script )
15701572
{
15711573
for (i = 0; i < package->script_actions_count[script]; i++)
15721574
{
1573-
rc = ACTION_PerformAction(package, package->script_actions[script][i], script);
1575+
rc = ACTION_PerformAction(package, package->script_actions[script][i]);
15741576
if (rc != ERROR_SUCCESS)
15751577
{
15761578
ERR("Execution of script %i halted; action %s returned %u\n",
@@ -1579,6 +1581,9 @@ static UINT execute_script( MSIPACKAGE *package, UINT script )
15791581
}
15801582
}
15811583
}
1584+
1585+
package->script = SCRIPT_NONE;
1586+
15821587
msi_free_action_script(package, script);
15831588
return rc;
15841589
}
@@ -5686,7 +5691,7 @@ static UINT ACTION_ExecuteAction(MSIPACKAGE *package)
56865691
msiobj_release(&uirow->hdr);
56875692
}
56885693
else
5689-
rc = ACTION_PerformAction(package, action, SCRIPT_NONE);
5694+
rc = ACTION_PerformAction(package, action);
56905695

56915696
/* Send all set properties. */
56925697
if (!MSI_OpenQuery(package->db, &view, prop_query))
@@ -7937,7 +7942,7 @@ static UINT ACTION_HandleStandardAction(MSIPACKAGE *package, LPCWSTR action)
79377942
return rc;
79387943
}
79397944

7940-
UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, UINT script)
7945+
UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action)
79417946
{
79427947
UINT rc;
79437948

@@ -7947,7 +7952,7 @@ UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, UINT script)
79477952
rc = ACTION_HandleStandardAction(package, action);
79487953

79497954
if (rc == ERROR_FUNCTION_NOT_CALLED)
7950-
rc = ACTION_HandleCustomAction(package, action, script);
7955+
rc = ACTION_HandleCustomAction(package, action);
79517956

79527957
if (rc == ERROR_FUNCTION_NOT_CALLED)
79537958
WARN("unhandled msi action %s\n", debugstr_w(action));
@@ -8000,7 +8005,7 @@ static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq)
80008005
return ERROR_FUNCTION_FAILED;
80018006
}
80028007

8003-
rc = ACTION_PerformAction(package, action, SCRIPT_NONE);
8008+
rc = ACTION_PerformAction(package, action);
80048009

80058010
msiobj_release(&row->hdr);
80068011
}
@@ -8128,7 +8133,7 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
81288133
msi_set_property( package->db, szRollbackDisabled, szOne, -1 );
81298134
}
81308135

8131-
rc = ACTION_PerformAction(package, action, SCRIPT_NONE);
8136+
rc = ACTION_PerformAction(package, action);
81328137

81338138
/* process the ending type action */
81348139
if (rc == ERROR_SUCCESS)

dll/win32/msi/custom.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ static UINT defer_custom_action( MSIPACKAGE *package, const WCHAR *action, UINT
12091209
return ERROR_SUCCESS;
12101210
}
12111211

1212-
UINT ACTION_CustomAction( MSIPACKAGE *package, LPCWSTR action, UINT script )
1212+
UINT ACTION_CustomAction(MSIPACKAGE *package, const WCHAR *action)
12131213
{
12141214
static const WCHAR query[] = {
12151215
'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
@@ -1249,7 +1249,7 @@ UINT ACTION_CustomAction( MSIPACKAGE *package, LPCWSTR action, UINT script )
12491249
if (type & msidbCustomActionTypeNoImpersonate)
12501250
WARN("msidbCustomActionTypeNoImpersonate not handled\n");
12511251

1252-
if (!action_type_matches_script( type, script ))
1252+
if (!action_type_matches_script(type, package->script))
12531253
{
12541254
rc = defer_custom_action( package, action, type );
12551255
goto end;

dll/win32/msi/dialog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4380,7 +4380,7 @@ static UINT event_spawn_wait_dialog( msi_dialog *dialog, const WCHAR *argument )
43804380

43814381
static UINT event_do_action( msi_dialog *dialog, const WCHAR *argument )
43824382
{
4383-
ACTION_PerformAction( dialog->package, argument, SCRIPT_NONE );
4383+
ACTION_PerformAction(dialog->package, argument);
43844384
return ERROR_SUCCESS;
43854385
}
43864386

dll/win32/msi/install.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ UINT WINAPI MsiDoActionW( MSIHANDLE hInstall, LPCWSTR szAction )
8383
return remote_DoAction(remote, szAction);
8484
}
8585

86-
ret = ACTION_PerformAction( package, szAction, SCRIPT_NONE );
86+
ret = ACTION_PerformAction(package, szAction);
8787
msiobj_release( &package->hdr );
8888

8989
return ret;

dll/win32/msi/msi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3742,7 +3742,7 @@ UINT WINAPI MsiCollectUserInfoW(LPCWSTR szProduct)
37423742
if (!package)
37433743
return ERROR_CALL_NOT_IMPLEMENTED;
37443744

3745-
rc = ACTION_PerformAction(package, szFirstRun, SCRIPT_NONE);
3745+
rc = ACTION_PerformAction(package, szFirstRun);
37463746
msiobj_release( &package->hdr );
37473747

37483748
MsiCloseHandle(handle);
@@ -3768,7 +3768,7 @@ UINT WINAPI MsiCollectUserInfoA(LPCSTR szProduct)
37683768
if (!package)
37693769
return ERROR_CALL_NOT_IMPLEMENTED;
37703770

3771-
rc = ACTION_PerformAction(package, szFirstRun, SCRIPT_NONE);
3771+
rc = ACTION_PerformAction(package, szFirstRun);
37723772
msiobj_release( &package->hdr );
37733773

37743774
MsiCloseHandle(handle);
@@ -3849,7 +3849,7 @@ UINT WINAPI MsiConfigureFeatureW(LPCWSTR szProduct, LPCWSTR szFeature, INSTALLST
38493849

38503850
MsiSetInternalUI( INSTALLUILEVEL_BASIC, NULL );
38513851

3852-
r = ACTION_PerformAction( package, szCostInitialize, SCRIPT_NONE );
3852+
r = ACTION_PerformAction(package, szCostInitialize);
38533853
if (r != ERROR_SUCCESS)
38543854
goto end;
38553855

dll/win32/msi/msipriv.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ typedef struct tagMSIPACKAGE
414414
struct list mimes;
415415
struct list appids;
416416

417+
enum script script;
417418
LPWSTR *script_actions[SCRIPT_MAX];
418419
int script_actions_count[SCRIPT_MAX];
419420
LPWSTR *unique_actions;
@@ -976,9 +977,9 @@ extern WCHAR *gszLogFile DECLSPEC_HIDDEN;
976977
extern HINSTANCE msi_hInstance DECLSPEC_HIDDEN;
977978

978979
/* action related functions */
979-
extern UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, UINT script) DECLSPEC_HIDDEN;
980+
extern UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action) DECLSPEC_HIDDEN;
980981
extern void ACTION_FinishCustomActions( const MSIPACKAGE* package) DECLSPEC_HIDDEN;
981-
extern UINT ACTION_CustomAction(MSIPACKAGE *, const WCHAR *, UINT) DECLSPEC_HIDDEN;
982+
extern UINT ACTION_CustomAction(MSIPACKAGE *package, const WCHAR *action) DECLSPEC_HIDDEN;
982983

983984
/* actions in other modules */
984985
extern UINT ACTION_AppSearch(MSIPACKAGE *package) DECLSPEC_HIDDEN;

dll/win32/msi/package.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,7 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db )
11191119
msi_load_admin_properties( package );
11201120

11211121
package->log_file = INVALID_HANDLE_VALUE;
1122+
package->script = SCRIPT_NONE;
11221123
}
11231124
return package;
11241125
}

0 commit comments

Comments
 (0)