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
b9a29e22
Commit
b9a29e22
authored
Nov 01, 2007
by
James Hawkins
Committed by
Alexandre Julliard
Nov 01, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Test the MoveFiles standard action.
parent
eb31959a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
140 additions
and
0 deletions
+140
-0
install.c
dlls/msi/tests/install.c
+140
-0
No files found.
dlls/msi/tests/install.c
View file @
b9a29e22
...
...
@@ -109,6 +109,8 @@ static const CHAR install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
"CostFinalize
\t\t
1000
\n
"
"CostInitialize
\t\t
800
\n
"
"FileCost
\t\t
900
\n
"
"ResolveSource
\t\t
950
\n
"
"MoveFiles
\t\t
1700
\n
"
"InstallFiles
\t\t
4000
\n
"
"InstallServices
\t\t
5000
\n
"
"InstallFinalize
\t\t
6600
\n
"
...
...
@@ -508,6 +510,27 @@ static const CHAR rem_remove_files_dat[] = "FileKey\tComponent_\tFileName\tDirPr
"block
\t
helium
\t
block
\t
MSITESTDIR
\t
3
\n
"
"siriometer
\t
lithium
\t
siriometer
\t
MSITESTDIR
\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
"
"MoveFile
\t
FileKey
\n
"
"abkhazia
\t
augustus
\t
nonexistent
\t
dest
\t
SourceDir
\t
MSITESTDIR
\t
0
\n
"
"bahamas
\t
augustus
\t
nonexistent
\t
dest
\t
SourceDir
\t
MSITESTDIR
\t
1
\n
"
"cambodia
\t
augustus
\t
cameroon
\t
canada
\t
SourceDir
\t
MSITESTDIR
\t
0
\n
"
"denmark
\t
augustus
\t
djibouti
\t
dominica
\t
SourceDir
\t
MSITESTDIR
\t
1
\n
"
"ecuador
\t
augustus
\t
egypt
\t
elsalvador
\t
NotAProp
\t
MSITESTDIR
\t
1
\n
"
"fiji
\t
augustus
\t
finland
\t
france
\t
SourceDir
\t
NotAProp
\t
1
\n
"
"gabon
\t
augustus
\t
gambia
\t
georgia
\t
SOURCEFULL
\t
MSITESTDIR
\t
1
\n
"
"haiti
\t
augustus
\t
honduras
\t
hungary
\t
SourceDir
\t
DESTFULL
\t
1
\n
"
"iceland
\t
augustus
\t
india
\t
indonesia
\t
MSITESTDIR
\t
MSITESTDIR
\t
1
\n
"
"jamaica
\t
augustus
\t
japan
\t
jordan
\t
FILEPATHBAD
\t
MSITESTDIR
\t
1
\n
"
"kazakhstan
\t
augustus
\t\t
kiribati
\t
FILEPATHGOOD
\t
MSITESTDIR
\t
1
\n
"
"laos
\t
augustus
\t
latvia
\t
lebanon
\t
SourceDir
\t
MSITESTDIR
\t
1
\n
"
"namibia
\t
augustus
\t
nauru
\t
kiribati
\t
SourceDir
\t
MSITESTDIR
\t
1
\n
"
"wildcard
\t
augustus
\t
app*
\t
wildcard
\t
SourceDir
\t
MSITESTDIR
\t
1
\n
"
"single
\t
augustus
\t
f?o
\t
single
\t
SourceDir
\t
MSITESTDIR
\t
1
\n
"
"wildcardnodest
\t
augustus
\t
budd*
\t\t
SourceDir
\t
MSITESTDIR
\t
1
\n
"
"singlenodest
\t
augustus
\t
b?r
\t\t
SourceDir
\t
MSITESTDIR
\t
1
\n
"
;
typedef
struct
_msi_table
{
const
CHAR
*
filename
;
...
...
@@ -757,6 +780,20 @@ static const msi_table rem_tables[] =
ADD_TABLE
(
rem_remove_files
),
};
static
const
msi_table
mov_tables
[]
=
{
ADD_TABLE
(
cwd_component
),
ADD_TABLE
(
directory
),
ADD_TABLE
(
rof_feature
),
ADD_TABLE
(
ci2_feature_comp
),
ADD_TABLE
(
ci2_file
),
ADD_TABLE
(
install_exec_seq
),
ADD_TABLE
(
rof_media
),
ADD_TABLE
(
property
),
ADD_TABLE
(
mov_move_file
),
ADD_TABLE
(
registry
),
};
/* cabinet definitions */
/* make the max size large so there is only one cab file */
...
...
@@ -2896,6 +2933,108 @@ static void test_removefiles(void)
RemoveDirectory
(
"msitest"
);
}
static
void
test_movefiles
(
void
)
{
UINT
r
;
char
props
[
MAX_PATH
];
CreateDirectoryA
(
"msitest"
,
NULL
);
create_file
(
"msitest
\\
augustus"
,
100
);
create_file
(
"cameroon"
,
100
);
create_file
(
"djibouti"
,
100
);
create_file
(
"egypt"
,
100
);
create_file
(
"finland"
,
100
);
create_file
(
"gambai"
,
100
);
create_file
(
"honduras"
,
100
);
create_file
(
"msitest
\\
india"
,
100
);
create_file
(
"japan"
,
100
);
create_file
(
"kenya"
,
100
);
CreateDirectoryA
(
"latvia"
,
NULL
);
create_file
(
"nauru"
,
100
);
create_file
(
"apple"
,
100
);
create_file
(
"application"
,
100
);
create_file
(
"ape"
,
100
);
create_file
(
"foo"
,
100
);
create_file
(
"fao"
,
100
);
create_file
(
"fbod"
,
100
);
create_file
(
"budding"
,
100
);
create_file
(
"buddy"
,
100
);
create_file
(
"bud"
,
100
);
create_file
(
"bar"
,
100
);
create_file
(
"bur"
,
100
);
create_file
(
"bird"
,
100
);
create_database
(
msifile
,
mov_tables
,
sizeof
(
mov_tables
)
/
sizeof
(
msi_table
));
MsiSetInternalUI
(
INSTALLUILEVEL_FULL
,
NULL
);
MsiEnableLog
(
INSTALLLOGMODE_VERBOSE
|
INSTALLLOGMODE_EXTRADEBUG
,
"log.txt"
,
0
);
/* if the source or dest property is not a full path,
* windows tries to access it as a network resource
*/
sprintf
(
props
,
"SOURCEFULL=
\"
%s
\\\"
DESTFULL=
\"
%s
\\
msitest
\"
"
"FILEPATHBAD=
\"
%s
\\
japan
\"
FILEPATHGOOD=
\"
%s
\\
kenya
\"
"
,
CURR_DIR
,
PROG_FILES_DIR
,
CURR_DIR
,
CURR_DIR
);
r
=
MsiInstallProductA
(
msifile
,
props
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
delete_pf
(
"msitest
\\
augustus"
,
TRUE
),
"File not installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
dest"
,
TRUE
),
"File copied
\n
"
);
todo_wine
ok
(
delete_pf
(
"msitest
\\
canada"
,
TRUE
),
"File not copied
\n
"
);
todo_wine
ok
(
delete_pf
(
"msitest
\\
dominica"
,
TRUE
),
"File not moved
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
elsalvador"
,
TRUE
),
"File moved
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
france"
,
TRUE
),
"File moved
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
georgia"
,
TRUE
),
"File moved
\n
"
);
todo_wine
ok
(
delete_pf
(
"msitest
\\
hungary"
,
TRUE
),
"File not moved
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
indonesia"
,
TRUE
),
"File moved
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
jordan"
,
TRUE
),
"File moved
\n
"
);
todo_wine
ok
(
delete_pf
(
"msitest
\\
kiribati"
,
TRUE
),
"File not moved
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
lebanon"
,
TRUE
),
"File moved
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
lebanon"
,
FALSE
),
"Directory moved
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
apple"
,
TRUE
),
"File should not exist
\n
"
);
todo_wine
ok
(
delete_pf
(
"msitest
\\
wildcard"
,
TRUE
),
"File not moved
\n
"
);
todo_wine
ok
(
delete_pf
(
"msitest
\\
application"
,
TRUE
),
"File not moved
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
ape"
,
TRUE
),
"File moved
\n
"
);
todo_wine
ok
(
delete_pf
(
"msitest
\\
foo"
,
TRUE
),
"File not moved
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
fao"
,
TRUE
),
"File should not exist
\n
"
);
todo_wine
ok
(
delete_pf
(
"msitest
\\
single"
,
TRUE
),
"File not moved
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
fbod"
,
TRUE
),
"File moved
\n
"
);
todo_wine
ok
(
delete_pf
(
"msitest
\\
budding"
,
TRUE
),
"File not moved
\n
"
);
todo_wine
ok
(
delete_pf
(
"msitest
\\
buddy"
,
TRUE
),
"File not moved
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
bud"
,
TRUE
),
"File moved
\n
"
);
todo_wine
ok
(
delete_pf
(
"msitest
\\
bar"
,
TRUE
),
"File not moved
\n
"
);
todo_wine
ok
(
delete_pf
(
"msitest
\\
bur"
,
TRUE
),
"File not moved
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
bird"
,
TRUE
),
"File moved
\n
"
);
ok
(
delete_pf
(
"msitest"
,
FALSE
),
"File not installed
\n
"
);
ok
(
DeleteFileA
(
"cameroon"
),
"File moved
\n
"
);
todo_wine
ok
(
!
DeleteFileA
(
"djibouti"
),
"File not moved
\n
"
);
ok
(
DeleteFileA
(
"egypt"
),
"File moved
\n
"
);
ok
(
DeleteFileA
(
"finland"
),
"File moved
\n
"
);
ok
(
DeleteFileA
(
"gambai"
),
"File moved
\n
"
);
todo_wine
ok
(
!
DeleteFileA
(
"honduras"
),
"File not moved
\n
"
);
ok
(
DeleteFileA
(
"msitest
\\
india"
),
"File moved
\n
"
);
ok
(
DeleteFileA
(
"japan"
),
"File moved
\n
"
);
todo_wine
ok
(
!
DeleteFileA
(
"kenya"
),
"File not moved
\n
"
);
ok
(
RemoveDirectoryA
(
"latvia"
),
"Directory moved
\n
"
);
todo_wine
ok
(
!
DeleteFileA
(
"nauru"
),
"File not moved
\n
"
);
todo_wine
ok
(
!
DeleteFileA
(
"apple"
),
"File not moved
\n
"
);
todo_wine
ok
(
!
DeleteFileA
(
"application"
),
"File not moved
\n
"
);
ok
(
DeleteFileA
(
"ape"
),
"File moved
\n
"
);
todo_wine
ok
(
!
DeleteFileA
(
"foo"
),
"File not moved
\n
"
);
todo_wine
ok
(
!
DeleteFileA
(
"fao"
),
"File not moved
\n
"
);
ok
(
DeleteFileA
(
"fbod"
),
"File moved
\n
"
);
todo_wine
ok
(
!
DeleteFileA
(
"budding"
),
"File not moved
\n
"
);
todo_wine
ok
(
!
DeleteFileA
(
"buddy"
),
"File not moved
\n
"
);
ok
(
DeleteFileA
(
"bud"
),
"File moved
\n
"
);
todo_wine
ok
(
!
DeleteFileA
(
"bar"
),
"File not moved
\n
"
);
todo_wine
ok
(
!
DeleteFileA
(
"bur"
),
"File not moved
\n
"
);
ok
(
DeleteFileA
(
"bird"
),
"File moved
\n
"
);
DeleteFile
(
"msitest
\\
augustus"
);
RemoveDirectory
(
"msitest"
);
DeleteFile
(
msifile
);
}
START_TEST
(
install
)
{
DWORD
len
;
...
...
@@ -2935,6 +3074,7 @@ START_TEST(install)
test_admin
();
test_adminprops
();
test_removefiles
();
test_movefiles
();
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