Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
7b858882
Commit
7b858882
authored
Aug 21, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Aug 21, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: If the filename is empty or NULL, remove the directory.
parent
96dd6ce1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
8 deletions
+37
-8
files.c
dlls/msi/files.c
+15
-5
install.c
dlls/msi/tests/install.c
+22
-3
No files found.
dlls/msi/files.c
View file @
7b858882
...
...
@@ -491,7 +491,8 @@ static UINT ITERATE_RemoveFiles(MSIRECORD *row, LPVOID param)
if
(
!
dir
)
return
ERROR_OUTOFMEMORY
;
size
=
lstrlenW
(
filename
)
+
lstrlenW
(
dir
)
+
2
;
size
=
(
filename
!=
NULL
)
?
lstrlenW
(
filename
)
:
0
;
size
+=
lstrlenW
(
dir
)
+
2
;
path
=
msi_alloc
(
size
*
sizeof
(
WCHAR
));
if
(
!
path
)
{
...
...
@@ -500,11 +501,20 @@ static UINT ITERATE_RemoveFiles(MSIRECORD *row, LPVOID param)
}
lstrcpyW
(
path
,
dir
);
lstrcatW
(
path
,
filename
);
PathAddBackslashW
(
path
);
TRACE
(
"Deleting misc file: %s
\n
"
,
debugstr_w
(
path
));
if
(
!
DeleteFileW
(
path
))
TRACE
(
"DeleteFileW failed: %d
\n
"
,
GetLastError
());
if
(
filename
)
{
lstrcatW
(
path
,
filename
);
TRACE
(
"Deleting misc file: %s
\n
"
,
debugstr_w
(
path
));
DeleteFileW
(
path
);
}
else
{
TRACE
(
"Removing misc directory: %s
\n
"
,
debugstr_w
(
path
));
RemoveDirectoryW
(
path
);
}
done:
msi_free
(
path
);
...
...
dlls/msi/tests/install.c
View file @
7b858882
...
...
@@ -551,7 +551,8 @@ static const CHAR rem_remove_files_dat[] = "FileKey\tComponent_\tFileName\tDirPr
"attoparsec
\t
lithium
\t
attoparsec
\t
MSITESTDIR
\t
2
\n
"
"storeys
\t
hydrogen
\t
storeys
\t
MSITESTDIR
\t
3
\n
"
"block
\t
helium
\t
block
\t
MSITESTDIR
\t
3
\n
"
"siriometer
\t
lithium
\t
siriometer
\t
MSITESTDIR
\t
3
\n
"
;
"siriometer
\t
lithium
\t
siriometer
\t
MSITESTDIR
\t
3
\n
"
"nanoacre
\t
hydrogen
\t\t
CABOUTDIR
\t
3
\n
"
;
static
const
CHAR
mov_move_file_dat
[]
=
"FileKey
\t
Component_
\t
SourceName
\t
DestName
\t
SourceFolder
\t
DestFolder
\t
Options
\n
"
"s72
\t
s72
\t
S255
\t
S255
\t
S72
\t
s72
\t
i2
\n
"
...
...
@@ -4228,7 +4229,6 @@ static void test_removefiles(void)
create_file
(
"msitest
\\
hydrogen"
,
500
);
create_file
(
"msitest
\\
helium"
,
500
);
create_file
(
"msitest
\\
lithium"
,
500
);
create_file
(
"msitest
\\
beryllium"
,
500
);
create_database
(
msifile
,
rem_tables
,
sizeof
(
rem_tables
)
/
sizeof
(
msi_table
));
...
...
@@ -4283,6 +4283,8 @@ static void test_removefiles(void)
create_pf
(
"msitest
\\
storeys"
,
TRUE
);
create_pf
(
"msitest
\\
block"
,
TRUE
);
create_pf
(
"msitest
\\
siriometer"
,
TRUE
);
create_pf
(
"msitest
\\
cabout"
,
FALSE
);
create_pf
(
"msitest
\\
cabout
\\
blocker"
,
TRUE
);
r
=
MsiInstallProductA
(
msifile
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
...
...
@@ -4298,6 +4300,7 @@ static void test_removefiles(void)
ok
(
!
pf_exists
(
"msitest
\\
storeys"
),
"File not deleted
\n
"
);
ok
(
!
pf_exists
(
"msitest
\\
block"
),
"File not deleted
\n
"
);
ok
(
!
pf_exists
(
"msitest
\\
siriometer"
),
"File not deleted
\n
"
);
ok
(
pf_exists
(
"msitest
\\
cabout"
),
"Directory removed
\n
"
);
ok
(
pf_exists
(
"msitest"
),
"File not installed
\n
"
);
create_pf
(
"msitest
\\
furlong"
,
TRUE
);
...
...
@@ -4324,7 +4327,23 @@ static void test_removefiles(void)
ok
(
!
delete_pf
(
"msitest
\\
storeys"
,
TRUE
),
"File not deleted
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
block"
,
TRUE
),
"File not deleted
\n
"
);
ok
(
delete_pf
(
"msitest
\\
siriometer"
,
TRUE
),
"File deleted
\n
"
);
ok
(
delete_pf
(
"msitest"
,
FALSE
),
"File deleted
\n
"
);
ok
(
pf_exists
(
"msitest
\\
cabout"
),
"Directory deleted
\n
"
);
ok
(
pf_exists
(
"msitest"
),
"Directory deleted
\n
"
);
r
=
MsiInstallProductA
(
msifile
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
delete_pf
(
"msitest
\\
hydrogen"
,
TRUE
),
"File not installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
helium"
,
TRUE
),
"File installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
lithium"
,
TRUE
),
"File not installed
\n
"
);
ok
(
pf_exists
(
"msitest
\\
cabout"
),
"Directory deleted
\n
"
);
ok
(
pf_exists
(
"msitest"
),
"Directory deleted
\n
"
);
delete_pf
(
"msitest
\\
cabout
\\
blocker"
,
TRUE
);
r
=
MsiInstallProductA
(
msifile
,
"REMOVE=ALL"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
!
delete_pf
(
"msitest
\\
cabout"
,
FALSE
),
"Directory not deleted
\n
"
);
ok
(
delete_pf
(
"msitest"
,
FALSE
),
"Directory deleted
\n
"
);
DeleteFile
(
msifile
);
DeleteFile
(
"msitest
\\
hydrogen"
);
...
...
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