msi: Remove a superfluous substructure.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ffef8bd41c
commit
5245b9d3a8
|
@ -557,13 +557,13 @@ static UINT ACTION_ProcessExecSequence(MSIPACKAGE *package)
|
|||
MSIQUERY *view;
|
||||
UINT rc;
|
||||
|
||||
if (package->script->ExecuteSequenceRun)
|
||||
if (package->ExecuteSequenceRun)
|
||||
{
|
||||
TRACE("Execute Sequence already Run\n");
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
package->script->ExecuteSequenceRun = TRUE;
|
||||
package->ExecuteSequenceRun = TRUE;
|
||||
|
||||
rc = MSI_OpenQuery(package->db, &view, query);
|
||||
if (rc == ERROR_SUCCESS)
|
||||
|
@ -1536,39 +1536,36 @@ static UINT ACTION_CostInitialize(MSIPACKAGE *package)
|
|||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static UINT execute_script_action( MSIPACKAGE *package, UINT script, UINT index )
|
||||
{
|
||||
const WCHAR *action = package->script->Actions[script][index];
|
||||
ui_actionstart( package, action, NULL, NULL );
|
||||
TRACE("executing %s\n", debugstr_w(action));
|
||||
return ACTION_PerformAction( package, action, script );
|
||||
}
|
||||
|
||||
static UINT execute_script( MSIPACKAGE *package, UINT script )
|
||||
{
|
||||
UINT i, rc = ERROR_SUCCESS;
|
||||
|
||||
TRACE("executing script %u\n", script);
|
||||
|
||||
if (!package->script)
|
||||
{
|
||||
ERR("no script!\n");
|
||||
return ERROR_FUNCTION_FAILED;
|
||||
}
|
||||
if (script == SCRIPT_ROLLBACK)
|
||||
{
|
||||
for (i = package->script->ActionCount[script]; i > 0; i--)
|
||||
for (i = package->script_actions_count[script]; i > 0; i--)
|
||||
{
|
||||
rc = execute_script_action( package, script, i - 1 );
|
||||
if (rc != ERROR_SUCCESS) break;
|
||||
rc = ACTION_PerformAction(package, package->script_actions[script][i-1], script);
|
||||
if (rc != ERROR_SUCCESS)
|
||||
{
|
||||
ERR("Execution of script %i halted; action %s returned %u\n",
|
||||
script, debugstr_w(package->script_actions[script][i-1]), rc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < package->script->ActionCount[script]; i++)
|
||||
for (i = 0; i < package->script_actions_count[script]; i++)
|
||||
{
|
||||
rc = execute_script_action( package, script, i );
|
||||
if (rc != ERROR_SUCCESS) break;
|
||||
rc = ACTION_PerformAction(package, package->script_actions[script][i], script);
|
||||
if (rc != ERROR_SUCCESS)
|
||||
{
|
||||
ERR("Execution of script %i halted; action %s returned %u\n",
|
||||
script, debugstr_w(package->script_actions[script][i]), rc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
msi_free_action_script(package, script);
|
||||
|
@ -5617,7 +5614,7 @@ static UINT ACTION_ExecuteAction(MSIPACKAGE *package)
|
|||
msiobj_release(&uirow->hdr);
|
||||
|
||||
/* Perform the installation. Always use the ExecuteSequence. */
|
||||
package->script->InWhatSequence |= SEQUENCE_EXEC;
|
||||
package->InWhatSequence |= SEQUENCE_EXEC;
|
||||
rc = ACTION_ProcessExecSequence(package);
|
||||
|
||||
/* Send return value and INSTALLEND. */
|
||||
|
@ -5671,7 +5668,7 @@ static UINT ACTION_INSTALL(MSIPACKAGE *package)
|
|||
msi_set_property(package->db, szEXECUTEACTION, szINSTALL, -1);
|
||||
if (needs_ui_sequence(package) && ui_sequence_exists(package))
|
||||
{
|
||||
package->script->InWhatSequence |= SEQUENCE_UI;
|
||||
package->InWhatSequence |= SEQUENCE_UI;
|
||||
return ACTION_ProcessUISequence(package);
|
||||
}
|
||||
else
|
||||
|
@ -7959,8 +7956,6 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
|
|||
UINT rc;
|
||||
DWORD len = 0;
|
||||
|
||||
package->script->InWhatSequence = SEQUENCE_INSTALL;
|
||||
|
||||
if (szPackagePath)
|
||||
{
|
||||
LPWSTR p, dir;
|
||||
|
|
|
@ -76,14 +76,14 @@ UINT msi_schedule_action( MSIPACKAGE *package, UINT script, const WCHAR *action
|
|||
}
|
||||
TRACE("Scheduling action %s in script %u\n", debugstr_w(action), script);
|
||||
|
||||
count = package->script->ActionCount[script];
|
||||
package->script->ActionCount[script]++;
|
||||
if (count != 0) newbuf = msi_realloc( package->script->Actions[script],
|
||||
package->script->ActionCount[script] * sizeof(WCHAR *) );
|
||||
count = package->script_actions_count[script];
|
||||
package->script_actions_count[script]++;
|
||||
if (count != 0) newbuf = msi_realloc( package->script_actions[script],
|
||||
package->script_actions_count[script] * sizeof(WCHAR *) );
|
||||
else newbuf = msi_alloc( sizeof(WCHAR *) );
|
||||
|
||||
newbuf[count] = strdupW( action );
|
||||
package->script->Actions[script] = newbuf;
|
||||
package->script_actions[script] = newbuf;
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -92,18 +92,16 @@ UINT msi_register_unique_action( MSIPACKAGE *package, const WCHAR *action )
|
|||
UINT count;
|
||||
WCHAR **newbuf = NULL;
|
||||
|
||||
if (!package->script) return FALSE;
|
||||
|
||||
TRACE("Registering %s as unique action\n", debugstr_w(action));
|
||||
|
||||
count = package->script->UniqueActionsCount;
|
||||
package->script->UniqueActionsCount++;
|
||||
if (count != 0) newbuf = msi_realloc( package->script->UniqueActions,
|
||||
package->script->UniqueActionsCount * sizeof(WCHAR *) );
|
||||
count = package->unique_actions_count;
|
||||
package->unique_actions_count++;
|
||||
if (count != 0) newbuf = msi_realloc( package->unique_actions,
|
||||
package->unique_actions_count * sizeof(WCHAR *) );
|
||||
else newbuf = msi_alloc( sizeof(WCHAR *) );
|
||||
|
||||
newbuf[count] = strdupW( action );
|
||||
package->script->UniqueActions = newbuf;
|
||||
package->unique_actions = newbuf;
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -111,25 +109,20 @@ BOOL msi_action_is_unique( const MSIPACKAGE *package, const WCHAR *action )
|
|||
{
|
||||
UINT i;
|
||||
|
||||
if (!package->script) return FALSE;
|
||||
|
||||
for (i = 0; i < package->script->UniqueActionsCount; i++)
|
||||
for (i = 0; i < package->unique_actions_count; i++)
|
||||
{
|
||||
if (!strcmpW( package->script->UniqueActions[i], action )) return TRUE;
|
||||
if (!strcmpW( package->unique_actions[i], action )) return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL check_execution_scheduling_options(MSIPACKAGE *package, LPCWSTR action, UINT options)
|
||||
{
|
||||
if (!package->script)
|
||||
return TRUE;
|
||||
|
||||
if ((options & msidbCustomActionTypeClientRepeat) ==
|
||||
msidbCustomActionTypeClientRepeat)
|
||||
{
|
||||
if (!(package->script->InWhatSequence & SEQUENCE_UI &&
|
||||
package->script->InWhatSequence & SEQUENCE_EXEC))
|
||||
if (!(package->InWhatSequence & SEQUENCE_UI &&
|
||||
package->InWhatSequence & SEQUENCE_EXEC))
|
||||
{
|
||||
TRACE("Skipping action due to dbCustomActionTypeClientRepeat option.\n");
|
||||
return FALSE;
|
||||
|
@ -137,8 +130,8 @@ static BOOL check_execution_scheduling_options(MSIPACKAGE *package, LPCWSTR acti
|
|||
}
|
||||
else if (options & msidbCustomActionTypeFirstSequence)
|
||||
{
|
||||
if (package->script->InWhatSequence & SEQUENCE_UI &&
|
||||
package->script->InWhatSequence & SEQUENCE_EXEC )
|
||||
if (package->InWhatSequence & SEQUENCE_UI &&
|
||||
package->InWhatSequence & SEQUENCE_EXEC )
|
||||
{
|
||||
TRACE("Skipping action due to msidbCustomActionTypeFirstSequence option.\n");
|
||||
return FALSE;
|
||||
|
|
|
@ -371,6 +371,15 @@ enum clr_version
|
|||
CLR_VERSION_MAX
|
||||
};
|
||||
|
||||
enum script
|
||||
{
|
||||
SCRIPT_NONE = -1,
|
||||
SCRIPT_INSTALL = 0,
|
||||
SCRIPT_COMMIT = 1,
|
||||
SCRIPT_ROLLBACK = 2,
|
||||
SCRIPT_MAX = 3
|
||||
};
|
||||
|
||||
typedef struct tagMSIPACKAGE
|
||||
{
|
||||
MSIOBJECTHDR hdr;
|
||||
|
@ -403,7 +412,12 @@ typedef struct tagMSIPACKAGE
|
|||
struct list mimes;
|
||||
struct list appids;
|
||||
|
||||
struct tagMSISCRIPT *script;
|
||||
LPWSTR *script_actions[SCRIPT_MAX];
|
||||
int script_actions_count[SCRIPT_MAX];
|
||||
LPWSTR *unique_actions;
|
||||
int unique_actions_count;
|
||||
BOOL ExecuteSequenceRun;
|
||||
UINT InWhatSequence;
|
||||
|
||||
struct list RunningActions;
|
||||
|
||||
|
@ -679,28 +693,8 @@ struct tagMSIMIME
|
|||
MSICLASS *Class;
|
||||
};
|
||||
|
||||
enum SCRIPTS
|
||||
{
|
||||
SCRIPT_NONE = -1,
|
||||
SCRIPT_INSTALL = 0,
|
||||
SCRIPT_COMMIT = 1,
|
||||
SCRIPT_ROLLBACK = 2,
|
||||
SCRIPT_MAX = 3
|
||||
};
|
||||
|
||||
#define SEQUENCE_UI 0x1
|
||||
#define SEQUENCE_EXEC 0x2
|
||||
#define SEQUENCE_INSTALL 0x10
|
||||
|
||||
typedef struct tagMSISCRIPT
|
||||
{
|
||||
LPWSTR *Actions[SCRIPT_MAX];
|
||||
UINT ActionCount[SCRIPT_MAX];
|
||||
BOOL ExecuteSequenceRun;
|
||||
UINT InWhatSequence;
|
||||
LPWSTR *UniqueActions;
|
||||
UINT UniqueActionsCount;
|
||||
} MSISCRIPT;
|
||||
|
||||
#define MSIHANDLETYPE_ANY 0
|
||||
#define MSIHANDLETYPE_DATABASE 1
|
||||
|
|
|
@ -129,17 +129,18 @@ static void free_assembly( MSIASSEMBLY *assembly )
|
|||
void msi_free_action_script( MSIPACKAGE *package, UINT script )
|
||||
{
|
||||
UINT i;
|
||||
for (i = 0; i < package->script->ActionCount[script]; i++)
|
||||
msi_free( package->script->Actions[script][i] );
|
||||
for (i = 0; i < package->script_actions_count[script]; i++)
|
||||
msi_free( package->script_actions[script][i] );
|
||||
|
||||
msi_free( package->script->Actions[script] );
|
||||
package->script->Actions[script] = NULL;
|
||||
package->script->ActionCount[script] = 0;
|
||||
msi_free( package->script_actions[script] );
|
||||
package->script_actions[script] = NULL;
|
||||
package->script_actions_count[script] = 0;
|
||||
}
|
||||
|
||||
static void free_package_structures( MSIPACKAGE *package )
|
||||
{
|
||||
struct list *item, *cursor;
|
||||
int i;
|
||||
|
||||
LIST_FOR_EACH_SAFE( item, cursor, &package->features )
|
||||
{
|
||||
|
@ -275,20 +276,12 @@ static void free_package_structures( MSIPACKAGE *package )
|
|||
msi_free( info );
|
||||
}
|
||||
|
||||
if (package->script)
|
||||
{
|
||||
INT i;
|
||||
UINT j;
|
||||
for (i = 0; i < SCRIPT_MAX; i++)
|
||||
msi_free_action_script( package, i );
|
||||
|
||||
for (i = 0; i < SCRIPT_MAX; i++)
|
||||
msi_free_action_script( package, i );
|
||||
|
||||
for (j = 0; j < package->script->UniqueActionsCount; j++)
|
||||
msi_free( package->script->UniqueActions[j] );
|
||||
|
||||
msi_free( package->script->UniqueActions );
|
||||
msi_free( package->script );
|
||||
}
|
||||
for (i = 0; i < package->unique_actions_count; i++)
|
||||
msi_free( package->unique_actions[i] );
|
||||
msi_free( package->unique_actions);
|
||||
|
||||
LIST_FOR_EACH_SAFE( item, cursor, &package->binaries )
|
||||
{
|
||||
|
@ -1087,7 +1080,6 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPCWSTR base_url )
|
|||
msi_adjust_privilege_properties( package );
|
||||
|
||||
package->ProductCode = msi_dup_property( package->db, szProductCode );
|
||||
package->script = msi_alloc_zero( sizeof(MSISCRIPT) );
|
||||
|
||||
set_installer_properties( package );
|
||||
|
||||
|
|
Loading…
Reference in New Issue