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
dfec94c1
Commit
dfec94c1
authored
Jul 28, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Jul 29, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add tests for MsiConfigureProductEx.
parent
cbf32ff2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
156 additions
and
0 deletions
+156
-0
install.c
dlls/msi/tests/install.c
+156
-0
No files found.
dlls/msi/tests/install.c
View file @
dfec94c1
...
...
@@ -705,6 +705,27 @@ static const CHAR sp_directory_dat[] = "Directory\tDirectory_Parent\tDefaultDir\
"ONEDIR
\t
MSITESTDIR
\t
.:shortone|longone
\n
"
"TWODIR
\t
ONEDIR
\t
.:shorttwo|longtwo"
;
static
const
CHAR
mcp_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
"
"hydrogen
\t
{C844BD1E-1907-4C00-8BC9-150BD70DF0A1}
\t
MSITESTDIR
\t
2
\t\t
hydrogen
\n
"
"helium
\t
{5AD3C142-CEF8-490D-B569-784D80670685}
\t
MSITESTDIR
\t
2
\t\t
helium
\n
"
"lithium
\t
{4AF28FFC-71C7-4307-BDE4-B77C5338F56F}
\t
MSITESTDIR
\t
2
\t
PROPVAR=42
\t
lithium
\n
"
;
static
const
CHAR
mcp_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
"
"hydroxyl
\t\t
hydroxyl
\t
hydroxyl
\t
2
\t
1
\t
TARGETDIR
\t
0
\n
"
"heliox
\t\t
heliox
\t
heliox
\t
2
\t
5
\t
TARGETDIR
\t
0
\n
"
"lithia
\t\t
lithia
\t
lithia
\t
2
\t
10
\t
TARGETDIR
\t
0"
;
static
const
CHAR
mcp_feature_comp_dat
[]
=
"Feature_
\t
Component_
\n
"
"s38
\t
s72
\n
"
"FeatureComponents
\t
Feature_
\t
Component_
\n
"
"hydroxyl
\t
hydrogen
\n
"
"heliox
\t
helium
\n
"
"lithia
\t
lithium"
;
typedef
struct
_msi_table
{
const
CHAR
*
filename
;
...
...
@@ -1067,6 +1088,18 @@ static const msi_table sp_tables[] =
ADD_TABLE
(
property
),
};
static
const
msi_table
mcp_tables
[]
=
{
ADD_TABLE
(
mcp_component
),
ADD_TABLE
(
directory
),
ADD_TABLE
(
mcp_feature
),
ADD_TABLE
(
mcp_feature_comp
),
ADD_TABLE
(
rem_file
),
ADD_TABLE
(
rem_install_exec_seq
),
ADD_TABLE
(
rof_media
),
ADD_TABLE
(
property
),
};
/* cabinet definitions */
/* make the max size large so there is only one cab file */
...
...
@@ -4951,6 +4984,128 @@ static void test_sourcepath(void)
DeleteFileA
(
msifile
);
}
static
void
test_MsiConfigureProductEx
(
void
)
{
UINT
r
;
CreateDirectoryA
(
"msitest"
,
NULL
);
create_file
(
"msitest
\\
hydrogen"
,
500
);
create_file
(
"msitest
\\
helium"
,
500
);
create_file
(
"msitest
\\
lithium"
,
500
);
create_database
(
msifile
,
mcp_tables
,
sizeof
(
mcp_tables
)
/
sizeof
(
msi_table
));
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
/* NULL szProduct */
r
=
MsiConfigureProductExA
(
NULL
,
INSTALLLEVEL_DEFAULT
,
INSTALLSTATE_DEFAULT
,
"PROPVAR=42"
);
ok
(
r
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
r
);
/* empty szProduct */
r
=
MsiConfigureProductExA
(
""
,
INSTALLLEVEL_DEFAULT
,
INSTALLSTATE_DEFAULT
,
"PROPVAR=42"
);
ok
(
r
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
r
);
/* garbage szProduct */
r
=
MsiConfigureProductExA
(
"garbage"
,
INSTALLLEVEL_DEFAULT
,
INSTALLSTATE_DEFAULT
,
"PROPVAR=42"
);
ok
(
r
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
r
);
/* guid without brackets */
r
=
MsiConfigureProductExA
(
"6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D"
,
INSTALLLEVEL_DEFAULT
,
INSTALLSTATE_DEFAULT
,
"PROPVAR=42"
);
ok
(
r
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
r
);
/* guid with brackets */
r
=
MsiConfigureProductExA
(
"{6700E8CF-95AB-4D9C-BC2C-15840DEA7A5D}"
,
INSTALLLEVEL_DEFAULT
,
INSTALLSTATE_DEFAULT
,
"PROPVAR=42"
);
ok
(
r
==
ERROR_UNKNOWN_PRODUCT
,
"Expected ERROR_UNKNOWN_PRODUCT, got %d
\n
"
,
r
);
/* same length as guid, but random */
r
=
MsiConfigureProductExA
(
"A938G02JF-2NF3N93-VN3-2NNF-3KGKALDNF93"
,
INSTALLLEVEL_DEFAULT
,
INSTALLSTATE_DEFAULT
,
"PROPVAR=42"
);
ok
(
r
==
ERROR_UNKNOWN_PRODUCT
,
"Expected ERROR_UNKNOWN_PRODUCT, got %d
\n
"
,
r
);
/* product not installed yet */
r
=
MsiConfigureProductExA
(
"{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"
,
INSTALLLEVEL_DEFAULT
,
INSTALLSTATE_DEFAULT
,
"PROPVAR=42"
);
ok
(
r
==
ERROR_UNKNOWN_PRODUCT
,
"Expected ERROR_UNKNOWN_PRODUCT, got %d
\n
"
,
r
);
/* install the product, per-user unmanaged */
r
=
MsiInstallProductA
(
msifile
,
"INSTALLLEVEL=10 PROPVAR=42"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
pf_exists
(
"msitest
\\
hydrogen"
),
"File not installed
\n
"
);
ok
(
pf_exists
(
"msitest
\\
helium"
),
"File not installed
\n
"
);
ok
(
pf_exists
(
"msitest
\\
lithium"
),
"File not installed
\n
"
);
ok
(
pf_exists
(
"msitest"
),
"File not installed
\n
"
);
/* product is installed per-user managed, remove it */
r
=
MsiConfigureProductExA
(
"{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"
,
INSTALLLEVEL_DEFAULT
,
INSTALLSTATE_ABSENT
,
"PROPVAR=42"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
delete_pf
(
"msitest
\\
hydrogen"
,
TRUE
),
"File not removed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
helium"
,
TRUE
),
"File not removed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
lithium"
,
TRUE
),
"File not removed
\n
"
);
ok
(
!
delete_pf
(
"msitest"
,
FALSE
),
"File not removed
\n
"
);
}
/* product has been removed */
r
=
MsiConfigureProductExA
(
"{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"
,
INSTALLLEVEL_DEFAULT
,
INSTALLSTATE_DEFAULT
,
"PROPVAR=42"
);
ok
(
r
==
ERROR_UNKNOWN_PRODUCT
,
"Expected ERROR_UNKNOWN_PRODUCT, got %u
\n
"
,
r
);
/* install the product, machine */
r
=
MsiInstallProductA
(
msifile
,
"ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
pf_exists
(
"msitest
\\
hydrogen"
),
"File not installed
\n
"
);
ok
(
pf_exists
(
"msitest
\\
helium"
),
"File not installed
\n
"
);
ok
(
pf_exists
(
"msitest
\\
lithium"
),
"File not installed
\n
"
);
ok
(
pf_exists
(
"msitest"
),
"File not installed
\n
"
);
/* product is installed machine, remove it */
r
=
MsiConfigureProductExA
(
"{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"
,
INSTALLLEVEL_DEFAULT
,
INSTALLSTATE_ABSENT
,
"PROPVAR=42"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
delete_pf
(
"msitest
\\
hydrogen"
,
TRUE
),
"File not removed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
helium"
,
TRUE
),
"File not removed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
lithium"
,
TRUE
),
"File not removed
\n
"
);
ok
(
!
delete_pf
(
"msitest"
,
FALSE
),
"File not removed
\n
"
);
}
/* product has been removed */
r
=
MsiConfigureProductExA
(
"{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"
,
INSTALLLEVEL_DEFAULT
,
INSTALLSTATE_DEFAULT
,
"PROPVAR=42"
);
ok
(
r
==
ERROR_UNKNOWN_PRODUCT
,
"Expected ERROR_UNKNOWN_PRODUCT, got %u
\n
"
,
r
);
DeleteFileA
(
msifile
);
DeleteFileA
(
"msitest
\\
hydrogen"
);
DeleteFileA
(
"msitest
\\
helium"
);
DeleteFileA
(
"msitest
\\
lithium"
);
RemoveDirectoryA
(
"msitest"
);
}
START_TEST
(
install
)
{
DWORD
len
;
...
...
@@ -5003,6 +5158,7 @@ START_TEST(install)
test_customaction51
();
test_installstate
();
test_sourcepath
();
test_MsiConfigureProductEx
();
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