Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
791fe136
Commit
791fe136
authored
Jun 30, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Remove directories after removing all files.
parent
12a55d91
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
37 deletions
+59
-37
action.c
dlls/msi/action.c
+29
-1
files.c
dlls/msi/files.c
+29
-35
msipriv.h
dlls/msi/msipriv.h
+1
-1
No files found.
dlls/msi/action.c
View file @
791fe136
...
...
@@ -878,7 +878,7 @@ static UINT ITERATE_CreateFolders(MSIRECORD *row, LPVOID param)
folder
=
msi_get_loaded_folder
(
package
,
dir
);
if
(
folder
->
State
==
FOLDER_STATE_UNINITIALIZED
)
msi_create_full_path
(
full_path
);
folder
->
State
=
FOLDER_STATE_CREATED
_PERSISTENT
;
folder
->
State
=
FOLDER_STATE_CREATED
;
return
ERROR_SUCCESS
;
}
...
...
@@ -1438,6 +1438,32 @@ static UINT load_all_patches(MSIPACKAGE *package)
return
ERROR_SUCCESS
;
}
static
UINT
load_folder_persistence
(
MSIPACKAGE
*
package
,
MSIFOLDER
*
folder
)
{
static
const
WCHAR
query
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'C'
,
'r'
,
'e'
,
'a'
,
't'
,
'e'
,
'F'
,
'o'
,
'l'
,
'd'
,
'e'
,
'r'
,
'`'
,
' '
,
'W'
,
'H'
,
'E'
,
'R'
,
'E'
,
' '
,
'`'
,
'D'
,
'i'
,
'r'
,
'e'
,
'c'
,
't'
,
'o'
,
'r'
,
'y'
,
'_'
,
'`'
,
' '
,
'='
,
'\''
,
'%'
,
's'
,
'\''
,
0
};
MSIQUERY
*
view
;
folder
->
persistent
=
FALSE
;
if
(
!
MSI_OpenQuery
(
package
->
db
,
&
view
,
query
,
folder
->
Directory
))
{
if
(
!
MSI_ViewExecute
(
view
,
NULL
))
{
MSIRECORD
*
rec
;
if
(
!
MSI_ViewFetch
(
view
,
&
rec
))
{
TRACE
(
"directory %s is persistent
\n
"
,
debugstr_w
(
folder
->
Directory
));
folder
->
persistent
=
TRUE
;
msiobj_release
(
&
rec
->
hdr
);
}
}
msiobj_release
(
&
view
->
hdr
);
}
return
ERROR_SUCCESS
;
}
static
UINT
load_folder
(
MSIRECORD
*
row
,
LPVOID
param
)
{
MSIPACKAGE
*
package
=
param
;
...
...
@@ -1488,6 +1514,8 @@ static UINT load_folder( MSIRECORD *row, LPVOID param )
TRACE
(
"SourceLong = %s
\n
"
,
debugstr_w
(
folder
->
SourceLongPath
));
TRACE
(
"SourceShort = %s
\n
"
,
debugstr_w
(
folder
->
SourceShortPath
));
load_folder_persistence
(
package
,
folder
);
list_add_tail
(
&
package
->
folders
,
&
folder
->
entry
);
return
ERROR_SUCCESS
;
}
...
...
dlls/msi/files.c
View file @
791fe136
...
...
@@ -1212,43 +1212,30 @@ done:
return
ret
;
}
static
BOOL
has_persistent_dir
(
MSIPACKAGE
*
package
,
MSICOMPONENT
*
comp
)
static
void
remove_folder
(
MSIFOLDER
*
folder
)
{
MSIQUERY
*
view
;
UINT
r
=
ERROR_FUNCTION_FAILED
;
static
const
WCHAR
query
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'C'
,
'r'
,
'e'
,
'a'
,
't'
,
'e'
,
'F'
,
'o'
,
'l'
,
'd'
,
'e'
,
'r'
,
'`'
,
' '
,
'W'
,
'H'
,
'E'
,
'R'
,
'E'
,
' '
,
'`'
,
'C'
,
'o'
,
'm'
,
'p'
,
'o'
,
'n'
,
'e'
,
'n'
,
't'
,
'_'
,
'`'
,
' '
,
'='
,
'\''
,
'%'
,
's'
,
'\''
,
' '
,
'A'
,
'N'
,
'D'
,
' '
,
'`'
,
'D'
,
'i'
,
'r'
,
'e'
,
'c'
,
't'
,
'o'
,
'r'
,
'y'
,
'_'
,
'`'
,
' '
,
'='
,
'\''
,
'%'
,
's'
,
'\''
,
0
};
FolderList
*
fl
;
if
(
!
MSI_OpenQuery
(
package
->
db
,
&
view
,
query
,
comp
->
Component
,
comp
->
Directory
))
{
if
(
!
MSI_ViewExecute
(
view
,
NULL
))
{
MSIRECORD
*
rec
;
if
(
!
(
r
=
MSI_ViewFetch
(
view
,
&
rec
)))
LIST_FOR_EACH_ENTRY
(
fl
,
&
folder
->
children
,
FolderList
,
entry
)
{
TRACE
(
"directory %s is persistent
\n
"
,
debugstr_w
(
comp
->
Directory
));
msiobj_release
(
&
rec
->
hdr
);
remove_folder
(
fl
->
folder
);
}
if
(
!
folder
->
persistent
&&
folder
->
State
!=
FOLDER_STATE_REMOVED
)
{
if
(
RemoveDirectoryW
(
folder
->
ResolvedTarget
))
folder
->
State
=
FOLDER_STATE_REMOVED
;
}
msiobj_release
(
&
view
->
hdr
);
}
return
(
r
==
ERROR_SUCCESS
);
}
UINT
ACTION_RemoveFiles
(
MSIPACKAGE
*
package
)
{
static
const
WCHAR
query
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'R'
,
'e'
,
'm'
,
'o'
,
'v'
,
'e'
,
'F'
,
'i'
,
'l'
,
'e'
,
'`'
,
0
};
MSIQUERY
*
view
;
MSICOMPONENT
*
comp
;
MSIFILE
*
file
;
UINT
r
;
static
const
WCHAR
query
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'R'
,
'e'
,
'm'
,
'o'
,
'v'
,
'e'
,
'F'
,
'i'
,
'l'
,
'e'
,
'`'
,
0
};
r
=
MSI_DatabaseOpenViewW
(
package
->
db
,
query
,
&
view
);
if
(
r
==
ERROR_SUCCESS
)
{
...
...
@@ -1259,10 +1246,9 @@ UINT ACTION_RemoveFiles( MSIPACKAGE *package )
LIST_FOR_EACH_ENTRY
(
file
,
&
package
->
files
,
MSIFILE
,
entry
)
{
MSIRECORD
*
uirow
;
LPWSTR
dir
,
p
;
VS_FIXEDFILEINFO
*
ver
;
MSICOMPONENT
*
comp
=
file
->
Component
;
comp
=
file
->
Component
;
msi_file_update_ui
(
package
,
file
,
szRemoveFiles
);
comp
->
Action
=
msi_get_component_action
(
package
,
comp
);
...
...
@@ -1300,15 +1286,6 @@ UINT ACTION_RemoveFiles( MSIPACKAGE *package )
{
WARN
(
"failed to delete %s (%u)
\n
"
,
debugstr_w
(
file
->
TargetPath
),
GetLastError
());
}
else
if
(
!
has_persistent_dir
(
package
,
comp
))
{
if
((
dir
=
strdupW
(
file
->
TargetPath
)))
{
if
((
p
=
strrchrW
(
dir
,
'\\'
)))
*
p
=
0
;
RemoveDirectoryW
(
dir
);
msi_free
(
dir
);
}
}
file
->
state
=
msifs_missing
;
uirow
=
MSI_CreateRecord
(
9
);
...
...
@@ -1317,5 +1294,22 @@ UINT ACTION_RemoveFiles( MSIPACKAGE *package )
msi_ui_actiondata
(
package
,
szRemoveFiles
,
uirow
);
msiobj_release
(
&
uirow
->
hdr
);
}
LIST_FOR_EACH_ENTRY
(
comp
,
&
package
->
components
,
MSICOMPONENT
,
entry
)
{
MSIFOLDER
*
folder
;
comp
->
Action
=
msi_get_component_action
(
package
,
comp
);
if
(
comp
->
Action
!=
INSTALLSTATE_ABSENT
)
continue
;
if
(
comp
->
assembly
&&
!
comp
->
assembly
->
application
)
continue
;
if
(
comp
->
Attributes
&
msidbComponentAttributesPermanent
)
{
TRACE
(
"permanent component, not removing directory
\n
"
);
continue
;
}
folder
=
msi_get_loaded_folder
(
package
,
comp
->
Directory
);
remove_folder
(
folder
);
}
return
ERROR_SUCCESS
;
}
dlls/msi/msipriv.h
View file @
791fe136
...
...
@@ -508,10 +508,10 @@ typedef struct tagMSIFOLDER
LPWSTR
TargetDefault
;
LPWSTR
SourceLongPath
;
LPWSTR
SourceShortPath
;
LPWSTR
ResolvedTarget
;
LPWSTR
ResolvedSource
;
enum
folder_state
State
;
BOOL
persistent
;
INT
Cost
;
INT
Space
;
}
MSIFOLDER
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment