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
5352d099
Commit
5352d099
authored
Jan 06, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Jan 07, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Create parent directories when duplicating files if they don't exist, with tests.
parent
837588c6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
0 deletions
+59
-0
files.c
dlls/msi/files.c
+1
-0
install.c
dlls/msi/tests/install.c
+58
-0
No files found.
dlls/msi/files.c
View file @
5352d099
...
...
@@ -901,6 +901,7 @@ static UINT ITERATE_DuplicateFiles(MSIRECORD *row, LPVOID param)
}
dest
=
build_directory_name
(
2
,
dest_path
,
dest_name
);
create_full_pathW
(
dest
);
TRACE
(
"Duplicating file %s to %s
\n
"
,
debugstr_w
(
file
->
TargetPath
),
debugstr_w
(
dest
));
...
...
dlls/msi/tests/install.c
View file @
5352d099
...
...
@@ -112,6 +112,7 @@ static const CHAR install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
"ResolveSource
\t\t
950
\n
"
"MoveFiles
\t\t
1700
\n
"
"InstallFiles
\t\t
4000
\n
"
"DuplicateFiles
\t\t
4500
\n
"
"InstallServices
\t\t
5000
\n
"
"InstallFinalize
\t\t
6600
\n
"
"InstallInitialize
\t\t
1500
\n
"
...
...
@@ -559,6 +560,22 @@ static const CHAR mc_file_hash_dat[] = "File_\tOptions\tHashPart1\tHashPart2\tHa
"MsiFileHash
\t
File_
\n
"
"caesar
\t
0
\t
850433704
\t
-241429251
\t
675791761
\t
-1221108824"
;
static
const
CHAR
df_directory_dat
[]
=
"Directory
\t
Directory_Parent
\t
DefaultDir
\n
"
"s72
\t
S72
\t
l255
\n
"
"Directory
\t
Directory
\n
"
"THIS
\t
MSITESTDIR
\t
this
\n
"
"DOESNT
\t
THIS
\t
doesnt
\n
"
"NONEXISTENT
\t
DOESNT
\t
exist
\n
"
"MSITESTDIR
\t
ProgramFilesFolder
\t
msitest
\n
"
"ProgramFilesFolder
\t
TARGETDIR
\t
.
\n
"
"TARGETDIR
\t\t
SourceDir"
;
static
const
CHAR
df_duplicate_file_dat
[]
=
"FileKey
\t
Component_
\t
File_
\t
DestName
\t
DestFolder
\n
"
"s72
\t
s72
\t
s72
\t
S255
\t
S72
\n
"
"DuplicateFile
\t
FileKey
\n
"
"maximus
\t
maximus
\t
maximus
\t
augustus
\t\n
"
"caesar
\t
maximus
\t
maximus
\t\t
NONEXISTENT
\n
"
;
typedef
struct
_msi_table
{
const
CHAR
*
filename
;
...
...
@@ -834,6 +851,19 @@ static const msi_table mc_tables[] =
ADD_TABLE
(
mc_file_hash
),
};
static
const
msi_table
df_tables
[]
=
{
ADD_TABLE
(
rof_component
),
ADD_TABLE
(
df_directory
),
ADD_TABLE
(
rof_feature
),
ADD_TABLE
(
rof_feature_comp
),
ADD_TABLE
(
rof_file
),
ADD_TABLE
(
install_exec_seq
),
ADD_TABLE
(
rof_media
),
ADD_TABLE
(
property
),
ADD_TABLE
(
df_duplicate_file
),
};
/* cabinet definitions */
/* make the max size large so there is only one cab file */
...
...
@@ -3568,6 +3598,33 @@ static void test_missingcab(void)
DeleteFile
(
msifile
);
}
static
void
test_duplicatefiles
(
void
)
{
UINT
r
;
CreateDirectoryA
(
"msitest"
,
NULL
);
create_file
(
"msitest
\\
maximus"
,
500
);
create_database
(
msifile
,
df_tables
,
sizeof
(
df_tables
)
/
sizeof
(
msi_table
));
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
/* fails if the destination folder is not a valid property */
r
=
MsiInstallProductA
(
msifile
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
delete_pf
(
"msitest
\\
maximus"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
augustus"
,
TRUE
),
"File not duplicated
\n
"
);
ok
(
delete_pf
(
"msitest
\\
this
\\
doesnt
\\
exist
\\
maximus"
,
TRUE
),
"File not duplicated
\n
"
);
ok
(
delete_pf
(
"msitest
\\
this
\\
doesnt
\\
exist"
,
FALSE
),
"File not duplicated
\n
"
);
ok
(
delete_pf
(
"msitest
\\
this
\\
doesnt"
,
FALSE
),
"File not duplicated
\n
"
);
ok
(
delete_pf
(
"msitest
\\
this"
,
FALSE
),
"File not duplicated
\n
"
);
ok
(
delete_pf
(
"msitest"
,
FALSE
),
"File not installed
\n
"
);
DeleteFile
(
"msitest
\\
maximus"
);
RemoveDirectory
(
"msitest"
);
DeleteFile
(
msifile
);
}
START_TEST
(
install
)
{
DWORD
len
;
...
...
@@ -3609,6 +3666,7 @@ START_TEST(install)
test_removefiles
();
test_movefiles
();
test_missingcab
();
test_duplicatefiles
();
SetCurrentDirectoryA
(
prev_path
);
}
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