[4/5] msi: Remove child folders first in the RemoveFolders action.
Hans Leidekker
hans at codeweavers.com
Mon Apr 23 08:46:50 CDT 2012
---
dlls/msi/action.c | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index eb755be..aa2cfca 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -884,6 +884,20 @@ static UINT ACTION_CreateFolders(MSIPACKAGE *package)
return rc;
}
+static void remove_persistent_folder( MSIFOLDER *folder )
+{
+ FolderList *fl;
+
+ LIST_FOR_EACH_ENTRY( fl, &folder->children, FolderList, entry )
+ {
+ remove_persistent_folder( fl->folder );
+ }
+ if (folder->persistent && folder->State != FOLDER_STATE_REMOVED)
+ {
+ if (RemoveDirectoryW( folder->ResolvedTarget )) folder->State = FOLDER_STATE_REMOVED;
+ }
+}
+
static UINT ITERATE_RemoveFolders( MSIRECORD *row, LPVOID param )
{
MSIPACKAGE *package = param;
@@ -927,9 +941,8 @@ static UINT ITERATE_RemoveFolders( MSIRECORD *row, LPVOID param )
msi_ui_actiondata( package, szRemoveFolders, uirow );
msiobj_release( &uirow->hdr );
- RemoveDirectoryW( full_path );
folder = msi_get_loaded_folder( package, dir );
- folder->State = FOLDER_STATE_REMOVED;
+ remove_persistent_folder( folder );
return ERROR_SUCCESS;
}
--
1.7.5.4
More information about the wine-patches
mailing list