Commit 9c845851 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Some installers don't call the CreateFolders action before the

InstallFiles action as MSDN specifies, but it still seems to work, so make sure that we create component directories in the InstallFiles action anyway.
parent c2584306
......@@ -1074,6 +1074,21 @@ static UINT msi_create_directory( MSIPACKAGE* package, LPCWSTR dir )
return rc;
}
UINT msi_create_component_directories( MSIPACKAGE *package )
{
MSICOMPONENT *comp;
/* create all the folders required by the components are going to install */
LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry )
{
if (!ACTION_VerifyComponentForAction(package, comp, INSTALLSTATE_LOCAL))
continue;
msi_create_directory( package, comp->Directory );
}
return ERROR_SUCCESS;
}
/*
* Also we cannot enable/disable components either, so for now I am just going
* to do all the directories for all the components.
......@@ -1087,7 +1102,6 @@ static UINT ACTION_CreateFolders(MSIPACKAGE *package)
'`','C','r','e','a','t','e','F','o','l','d','e','r','`',0 };
UINT rc;
MSIQUERY *view;
MSICOMPONENT *comp;
/* create all the empty folders specified in the CreateFolder table */
rc = MSI_DatabaseOpenViewW(package->db, ExecSeqQuery, &view );
......@@ -1097,13 +1111,7 @@ static UINT ACTION_CreateFolders(MSIPACKAGE *package)
rc = MSI_IterateRecords(view, NULL, ITERATE_CreateFolders, package);
msiobj_release(&view->hdr);
/* create all the folders required by the components are going to install */
LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry )
{
if (!ACTION_VerifyComponentForAction(package, comp, INSTALLSTATE_LOCAL))
continue;
msi_create_directory( package, comp->Directory );
}
msi_create_component_directories( package );
return rc;
}
......
......@@ -273,6 +273,7 @@ extern void ACTION_UpdateComponentStates(MSIPACKAGE *package, LPCWSTR szFeature)
extern UINT register_unique_action(MSIPACKAGE *, LPCWSTR);
extern BOOL check_unique_action(MSIPACKAGE *, LPCWSTR);
extern WCHAR* generate_error_string(MSIPACKAGE *, UINT, DWORD, ... );
extern UINT msi_create_component_directories( MSIPACKAGE *package );
/* control event stuff */
......
......@@ -674,6 +674,14 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
}
}
/*
* Despite MSDN specifying that the CreateFolders action
* should be called before InstallFiles, some installers don't
* do that, and they seem to work correctly. We need to create
* directories here to make sure that the files can be copied.
*/
msi_create_component_directories( package );
mi = create_media_info();
/* Pass 2 */
......
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