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
1f3f88bf
Commit
1f3f88bf
authored
Oct 23, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Oct 24, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add tests for installing from continuous cabinets.
parent
3fc13d4b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
117 additions
and
9 deletions
+117
-9
install.c
dlls/msi/tests/install.c
+117
-9
No files found.
dlls/msi/tests/install.c
View file @
1f3f88bf
...
...
@@ -147,6 +147,36 @@ static const CHAR service_control_dat[] = "ServiceControl\tName\tEvent\tArgument
"ServiceControl
\t
ServiceControl
\n
"
"ServiceControl
\t
TestService
\t
8
\t\t
0
\t
service_comp"
;
/* tables for test_continuouscabs */
static
const
CHAR
cc_component_dat
[]
=
"Component
\t
ComponentId
\t
Directory_
\t
Attributes
\t
Condition
\t
KeyPath
\n
"
"s72
\t
S38
\t
s72
\t
i2
\t
S255
\t
S72
\n
"
"Component
\t
Component
\n
"
"maximus
\t\t
MSITESTDIR
\t
0
\t
1
\t
maximus
\n
"
"augustus
\t\t
MSITESTDIR
\t
0
\t
1
\t
augustus"
;
static
const
CHAR
cc_feature_dat
[]
=
"Feature
\t
Feature_Parent
\t
Title
\t
Description
\t
Display
\t
Level
\t
Directory_
\t
Attributes
\n
"
"s38
\t
S38
\t
L64
\t
L255
\t
I2
\t
i2
\t
S72
\t
i2
\n
"
"Feature
\t
Feature
\n
"
"feature
\t\t\t\t
2
\t
1
\t
TARGETDIR
\t
0"
;
static
const
CHAR
cc_feature_comp_dat
[]
=
"Feature_
\t
Component_
\n
"
"s38
\t
s72
\n
"
"FeatureComponents
\t
Feature_
\t
Component_
\n
"
"feature
\t
maximus
\n
"
"feature
\t
augustus"
;
static
const
CHAR
cc_file_dat
[]
=
"File
\t
Component_
\t
FileName
\t
FileSize
\t
Version
\t
Language
\t
Attributes
\t
Sequence
\n
"
"s72
\t
s72
\t
l255
\t
i4
\t
S72
\t
S20
\t
I2
\t
i2
\n
"
"File
\t
File
\n
"
"maximus
\t
maximus
\t
maximus
\t
500
\t\t\t
16384
\t
1
\n
"
"augustus
\t
augustus
\t
augustus
\t
50000
\t\t\t
16384
\t
1"
;
static
const
CHAR
cc_media_dat
[]
=
"DiskId
\t
LastSequence
\t
DiskPrompt
\t
Cabinet
\t
VolumeLabel
\t
Source
\n
"
"i2
\t
i4
\t
L64
\t
S255
\t
S32
\t
S72
\n
"
"Media
\t
DiskId
\n
"
"1
\t
10
\t\t
test1.cab
\t
DISK1
\t\n
"
"2
\t
2
\t\t
test2.cab
\t
DISK2
\t\n
"
;
typedef
struct
_msi_table
{
const
CHAR
*
filename
;
...
...
@@ -171,10 +201,22 @@ static const msi_table tables[] =
ADD_TABLE
(
service_control
)
};
static
const
msi_table
cc_tables
[]
=
{
ADD_TABLE
(
cc_component
),
ADD_TABLE
(
directory
),
ADD_TABLE
(
cc_feature
),
ADD_TABLE
(
cc_feature_comp
),
ADD_TABLE
(
cc_file
),
ADD_TABLE
(
install_exec_seq
),
ADD_TABLE
(
cc_media
),
ADD_TABLE
(
property
),
};
/* cabinet definitions */
/* make the max size large so there is only one cab file */
#define MEDIA_SIZE
999999999
#define MEDIA_SIZE
0x7FFFFFFF
#define FOLDER_THRESHOLD 900000
/* the FCI callbacks */
...
...
@@ -191,6 +233,7 @@ static void mem_free(void *memory)
static
BOOL
get_next_cabinet
(
PCCAB
pccab
,
ULONG
cbPrevCab
,
void
*
pv
)
{
sprintf
(
pccab
->
szCab
,
pv
,
pccab
->
iCab
);
return
TRUE
;
}
...
...
@@ -336,11 +379,10 @@ static INT_PTR get_open_info(char *pszName, USHORT *pdate, USHORT *ptime,
return
(
INT_PTR
)
handle
;
}
static
void
add_file
(
HFCI
hfci
,
const
char
*
file
,
TCOMP
compress
)
static
BOOL
add_file
(
HFCI
hfci
,
const
char
*
file
,
TCOMP
compress
)
{
char
path
[
MAX_PATH
];
char
filename
[
MAX_PATH
];
BOOL
res
;
lstrcpyA
(
path
,
CURR_DIR
);
lstrcatA
(
path
,
"
\\
"
);
...
...
@@ -348,9 +390,8 @@ static void add_file(HFCI hfci, const char *file, TCOMP compress)
lstrcpyA
(
filename
,
file
);
res
=
FCIAddFile
(
hfci
,
path
,
filename
,
FALSE
,
get_next_cabinet
,
progress
,
get_open_info
,
compress
);
ok
(
res
,
"Expected FCIAddFile to succeed
\n
"
);
return
FCIAddFile
(
hfci
,
path
,
filename
,
FALSE
,
get_next_cabinet
,
progress
,
get_open_info
,
compress
);
}
static
void
set_cab_parameters
(
PCCAB
pCabParams
,
const
CHAR
*
name
,
DWORD
max_size
)
...
...
@@ -360,6 +401,7 @@ static void set_cab_parameters(PCCAB pCabParams, const CHAR *name, DWORD max_siz
pCabParams
->
cb
=
max_size
;
pCabParams
->
cbFolderThresh
=
FOLDER_THRESHOLD
;
pCabParams
->
setID
=
0xbeef
;
pCabParams
->
iCab
=
1
;
lstrcpyA
(
pCabParams
->
szCabPath
,
CURR_DIR
);
lstrcatA
(
pCabParams
->
szCabPath
,
"
\\
"
);
lstrcpyA
(
pCabParams
->
szCab
,
name
);
...
...
@@ -384,7 +426,8 @@ static void create_cab_file(const CHAR *name, DWORD max_size, const CHAR *files)
ptr
=
files
;
while
(
*
ptr
)
{
add_file
(
hfci
,
ptr
,
tcompTYPE_MSZIP
);
res
=
add_file
(
hfci
,
ptr
,
tcompTYPE_MSZIP
);
ok
(
res
,
"Failed to add file: %s
\n
"
,
ptr
);
ptr
+=
lstrlen
(
ptr
)
+
1
;
}
...
...
@@ -432,8 +475,6 @@ static void create_file(const CHAR *name, DWORD size)
static
void
create_test_files
(
void
)
{
get_program_files_dir
(
PROG_FILES_DIR
);
CreateDirectoryA
(
"msitest"
,
NULL
);
create_file
(
"msitest
\\
one.txt"
,
100
);
CreateDirectoryA
(
"msitest
\\
first"
,
NULL
);
...
...
@@ -716,10 +757,76 @@ static void test_packagecoltypes(void)
DeleteFile
(
msifile
);
}
static
void
create_cc_test_files
(
void
)
{
CCAB
cabParams
;
HFCI
hfci
;
ERF
erf
;
BOOL
res
;
create_file
(
"maximus"
,
500
);
create_file
(
"augustus"
,
50000
);
set_cab_parameters
(
&
cabParams
,
"test1.cab"
,
200
);
hfci
=
FCICreate
(
&
erf
,
file_placed
,
mem_alloc
,
mem_free
,
fci_open
,
fci_read
,
fci_write
,
fci_close
,
fci_seek
,
fci_delete
,
get_temp_file
,
&
cabParams
,
(
void
*
)
"test%d.cab"
);
ok
(
hfci
!=
NULL
,
"Failed to create an FCI context
\n
"
);
/* spews out hundreds of cab files. re-enable when cabinet.dll is fixed */
#if 0
res = add_file(hfci, "maximus", tcompTYPE_MSZIP);
ok(res, "Failed to add file maximus\n");
res = add_file(hfci, "augustus", tcompTYPE_MSZIP);
todo_wine
{
ok(res, "Failed to add file augustus\n");
}
#endif
res
=
FCIFlushCabinet
(
hfci
,
FALSE
,
get_next_cabinet
,
progress
);
ok
(
res
,
"Failed to flush the cabinet
\n
"
);
res
=
FCIDestroy
(
hfci
);
ok
(
res
,
"Failed to destroy the cabinet
\n
"
);
DeleteFile
(
"maximus"
);
DeleteFile
(
"augustus"
);
}
static
void
test_continuouscabs
(
void
)
{
UINT
r
;
create_cc_test_files
();
create_database
(
msifile
,
cc_tables
,
sizeof
(
cc_tables
)
/
sizeof
(
msi_table
));
r
=
MsiInstallProductA
(
msifile
,
NULL
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
}
todo_wine
{
ok
(
delete_pf
(
"msitest
\\
maximus"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
augustus"
,
TRUE
),
"File not installed
\n
"
);
}
ok
(
delete_pf
(
"msitest"
,
FALSE
),
"File not installed
\n
"
);
DeleteFile
(
"test1.cab"
);
DeleteFile
(
"test2.cab"
);
DeleteFile
(
msifile
);
}
START_TEST
(
install
)
{
DWORD
len
;
get_program_files_dir
(
PROG_FILES_DIR
);
GetCurrentDirectoryA
(
MAX_PATH
,
CURR_DIR
);
len
=
lstrlenA
(
CURR_DIR
);
...
...
@@ -729,4 +836,5 @@ START_TEST(install)
test_MsiInstallProduct
();
test_MsiSetComponentState
();
test_packagecoltypes
();
test_continuouscabs
();
}
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