Commit 2a9e0f1f authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

msi: Implement deferral for standard and custom actions.

parent c05dbc4b
......@@ -652,6 +652,9 @@ UINT ACTION_MsiPublishAssemblies( MSIPACKAGE *package )
{
MSICOMPONENT *comp;
if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szMsiPublishAssemblies);
LIST_FOR_EACH_ENTRY(comp, &package->components, MSICOMPONENT, entry)
{
LONG res;
......@@ -717,6 +720,9 @@ UINT ACTION_MsiUnpublishAssemblies( MSIPACKAGE *package )
{
MSICOMPONENT *comp;
if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szMsiUnpublishAssemblies);
LIST_FOR_EACH_ENTRY(comp, &package->components, MSICOMPONENT, entry)
{
LONG res;
......
......@@ -753,6 +753,9 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
MSICLASS *cls;
UINT r;
if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szRegisterClassInfo);
r = load_classes_and_such( package );
if (r != ERROR_SUCCESS)
return r;
......@@ -918,6 +921,9 @@ UINT ACTION_UnregisterClassInfo( MSIPACKAGE *package )
HKEY hkey, hkey2;
UINT r;
if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szUnregisterClassInfo);
r = load_classes_and_such( package );
if (r != ERROR_SUCCESS)
return r;
......@@ -1083,6 +1089,9 @@ UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package)
MSIRECORD *uirow;
UINT r;
if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szRegisterProgIdInfo);
r = load_classes_and_such( package );
if (r != ERROR_SUCCESS)
return r;
......@@ -1143,6 +1152,9 @@ UINT ACTION_UnregisterProgIdInfo( MSIPACKAGE *package )
LONG res;
UINT r;
if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szUnregisterProgIdInfo);
r = load_classes_and_such( package );
if (r != ERROR_SUCCESS)
return r;
......@@ -1255,6 +1267,9 @@ UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package)
LONG res;
UINT r;
if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szRegisterExtensionInfo);
r = load_classes_and_such( package );
if (r != ERROR_SUCCESS)
return r;
......@@ -1363,6 +1378,9 @@ UINT ACTION_UnregisterExtensionInfo( MSIPACKAGE *package )
LONG res;
UINT r;
if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szUnregisterExtensionInfo);
r = load_classes_and_such( package );
if (r != ERROR_SUCCESS)
return r;
......@@ -1446,6 +1464,9 @@ UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package)
MSIMIME *mt;
UINT r;
if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szRegisterMIMEInfo);
r = load_classes_and_such( package );
if (r != ERROR_SUCCESS)
return r;
......@@ -1500,6 +1521,9 @@ UINT ACTION_UnregisterMIMEInfo( MSIPACKAGE *package )
MSIMIME *mime;
UINT r;
if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szUnregisterMIMEInfo);
r = load_classes_and_such( package );
if (r != ERROR_SUCCESS)
return r;
......
......@@ -1245,6 +1245,7 @@ static BOOL action_type_matches_script( UINT type, UINT script )
switch (script)
{
case SCRIPT_NONE:
return FALSE;
case SCRIPT_INSTALL:
return !(type & msidbCustomActionTypeCommit) && !(type & msidbCustomActionTypeRollback);
case SCRIPT_COMMIT:
......
......@@ -359,6 +359,9 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
msi_set_sourcedir_props(package, FALSE);
if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szInstallFiles);
schedule_install_files(package);
mi = msi_alloc_zero( sizeof(MSIMEDIAINFO) );
......@@ -584,6 +587,9 @@ UINT ACTION_PatchFiles( MSIPACKAGE *package )
TRACE("%p\n", package);
if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szPatchFiles);
mi = msi_alloc_zero( sizeof(MSIMEDIAINFO) );
TRACE("extracting files\n");
......@@ -1002,6 +1008,9 @@ UINT ACTION_MoveFiles( MSIPACKAGE *package )
MSIQUERY *view;
UINT rc;
if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szMoveFiles);
rc = MSI_DatabaseOpenViewW(package->db, query, &view);
if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS;
......@@ -1134,6 +1143,9 @@ UINT ACTION_DuplicateFiles(MSIPACKAGE *package)
MSIQUERY *view;
UINT rc;
if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szDuplicateFiles);
rc = MSI_DatabaseOpenViewW(package->db, query, &view);
if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS;
......@@ -1210,6 +1222,9 @@ UINT ACTION_RemoveDuplicateFiles( MSIPACKAGE *package )
MSIQUERY *view;
UINT rc;
if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szRemoveDuplicateFiles);
rc = MSI_DatabaseOpenViewW( package->db, query, &view );
if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS;
......@@ -1350,6 +1365,9 @@ UINT ACTION_RemoveFiles( MSIPACKAGE *package )
MSIFILE *file;
UINT r;
if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szRemoveFiles);
r = MSI_DatabaseOpenViewW(package->db, query, &view);
if (r == ERROR_SUCCESS)
{
......
......@@ -294,6 +294,9 @@ UINT ACTION_RegisterFonts(MSIPACKAGE *package)
MSIQUERY *view;
UINT rc;
if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szRegisterFonts);
rc = MSI_DatabaseOpenViewW(package->db, query, &view);
if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS;
......@@ -374,6 +377,9 @@ UINT ACTION_UnregisterFonts( MSIPACKAGE *package )
MSIQUERY *view;
UINT r;
if (package->script == SCRIPT_NONE)
return msi_schedule_action(package, SCRIPT_INSTALL, szUnregisterFonts);
r = MSI_DatabaseOpenViewW( package->db, query, &view );
if (r != ERROR_SUCCESS)
return ERROR_SUCCESS;
......
......@@ -1190,6 +1190,7 @@ static const WCHAR szWow6432NodeCLSID[] = {'W','o','w','6','4','3','2','N','o','
static const WCHAR szStreams[] = {'_','S','t','r','e','a','m','s',0};
static const WCHAR szStorages[] = {'_','S','t','o','r','a','g','e','s',0};
static const WCHAR szMsiPublishAssemblies[] = {'M','s','i','P','u','b','l','i','s','h','A','s','s','e','m','b','l','i','e','s',0};
static const WCHAR szMsiUnpublishAssemblies[] = {'M','s','i','U','n','p','u','b','l','i','s','h','A','s','s','e','m','b','l','i','e','s',0};
static const WCHAR szCostingComplete[] = {'C','o','s','t','i','n','g','C','o','m','p','l','e','t','e',0};
static const WCHAR szTempFolder[] = {'T','e','m','p','F','o','l','d','e','r',0};
static const WCHAR szDatabase[] = {'D','A','T','A','B','A','S','E',0};
......
......@@ -6086,7 +6086,6 @@ static void test_deferred_action(void)
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
todo_wine
check_file_matches(file, "onetwo");
ok(DeleteFileA(file), "Directory not created\n");
......
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