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
d94653d0
Commit
d94653d0
authored
Apr 19, 2017
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Apply feature selection to the whole feature subtree.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
14d81d9e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
152 additions
and
34 deletions
+152
-34
action.c
dlls/msi/action.c
+45
-34
install.c
dlls/msi/tests/install.c
+107
-0
No files found.
dlls/msi/action.c
View file @
d94653d0
...
...
@@ -1772,6 +1772,45 @@ static BOOL process_overrides( MSIPACKAGE *package, int level )
return
ret
;
}
static
void
disable_children
(
MSIFEATURE
*
feature
,
int
level
)
{
FeatureList
*
fl
;
LIST_FOR_EACH_ENTRY
(
fl
,
&
feature
->
Children
,
FeatureList
,
entry
)
{
if
(
!
is_feature_selected
(
feature
,
level
))
{
TRACE
(
"child %s (level %d request %d) follows disabled parent %s (level %d request %d)
\n
"
,
debugstr_w
(
fl
->
feature
->
Feature
),
fl
->
feature
->
Level
,
fl
->
feature
->
ActionRequest
,
debugstr_w
(
feature
->
Feature
),
feature
->
Level
,
feature
->
ActionRequest
);
fl
->
feature
->
Level
=
feature
->
Level
;
fl
->
feature
->
Action
=
INSTALLSTATE_UNKNOWN
;
fl
->
feature
->
ActionRequest
=
INSTALLSTATE_UNKNOWN
;
}
disable_children
(
fl
->
feature
,
level
);
}
}
static
void
follow_parent
(
MSIFEATURE
*
feature
)
{
FeatureList
*
fl
;
LIST_FOR_EACH_ENTRY
(
fl
,
&
feature
->
Children
,
FeatureList
,
entry
)
{
if
(
fl
->
feature
->
Attributes
&
msidbFeatureAttributesFollowParent
)
{
TRACE
(
"child %s (level %d request %d) follows parent %s (level %d request %d)
\n
"
,
debugstr_w
(
fl
->
feature
->
Feature
),
fl
->
feature
->
Level
,
fl
->
feature
->
ActionRequest
,
debugstr_w
(
feature
->
Feature
),
feature
->
Level
,
feature
->
ActionRequest
);
fl
->
feature
->
Action
=
feature
->
Action
;
fl
->
feature
->
ActionRequest
=
feature
->
ActionRequest
;
}
follow_parent
(
fl
->
feature
);
}
}
UINT
MSI_SetFeatureStates
(
MSIPACKAGE
*
package
)
{
int
level
;
...
...
@@ -1810,24 +1849,9 @@ UINT MSI_SetFeatureStates(MSIPACKAGE *package)
/* disable child features of unselected parent or follow parent */
LIST_FOR_EACH_ENTRY
(
feature
,
&
package
->
features
,
MSIFEATURE
,
entry
)
{
FeatureList
*
fl
;
LIST_FOR_EACH_ENTRY
(
fl
,
&
feature
->
Children
,
FeatureList
,
entry
)
{
if
(
!
is_feature_selected
(
feature
,
level
))
{
fl
->
feature
->
Action
=
INSTALLSTATE_UNKNOWN
;
fl
->
feature
->
ActionRequest
=
INSTALLSTATE_UNKNOWN
;
}
else
if
(
fl
->
feature
->
Attributes
&
msidbFeatureAttributesFollowParent
)
{
TRACE
(
"feature %s (level %d request %d) follows parent %s (level %d request %d)
\n
"
,
debugstr_w
(
fl
->
feature
->
Feature
),
fl
->
feature
->
Level
,
fl
->
feature
->
ActionRequest
,
debugstr_w
(
feature
->
Feature
),
feature
->
Level
,
feature
->
ActionRequest
);
fl
->
feature
->
Action
=
feature
->
Action
;
fl
->
feature
->
ActionRequest
=
feature
->
ActionRequest
;
}
}
if
(
feature
->
Feature_Parent
)
continue
;
disable_children
(
feature
,
level
);
follow_parent
(
feature
);
}
}
else
/* preselected */
...
...
@@ -1852,22 +1876,9 @@ UINT MSI_SetFeatureStates(MSIPACKAGE *package)
}
LIST_FOR_EACH_ENTRY
(
feature
,
&
package
->
features
,
MSIFEATURE
,
entry
)
{
FeatureList
*
fl
;
if
(
!
is_feature_selected
(
feature
,
level
))
continue
;
LIST_FOR_EACH_ENTRY
(
fl
,
&
feature
->
Children
,
FeatureList
,
entry
)
{
if
(
fl
->
feature
->
Attributes
&
msidbFeatureAttributesFollowParent
&&
(
!
(
feature
->
Attributes
&
msidbFeatureAttributesFavorAdvertise
)))
{
TRACE
(
"feature %s (level %d request %d) follows parent %s (level %d request %d)
\n
"
,
debugstr_w
(
fl
->
feature
->
Feature
),
fl
->
feature
->
Level
,
fl
->
feature
->
ActionRequest
,
debugstr_w
(
feature
->
Feature
),
feature
->
Level
,
feature
->
ActionRequest
);
fl
->
feature
->
Action
=
feature
->
Action
;
fl
->
feature
->
ActionRequest
=
feature
->
ActionRequest
;
}
}
if
(
feature
->
Feature_Parent
)
continue
;
disable_children
(
feature
,
level
);
follow_parent
(
feature
);
}
}
...
...
dlls/msi/tests/install.c
View file @
d94653d0
...
...
@@ -1222,6 +1222,69 @@ static const char shc_install_exec_seq_dat[] =
"PublishProduct
\t\t
1900
\n
"
"InstallFinalize
\t\t
2000
\n
"
;
static
const
char
ft_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
"
"featuretree
\t
comp
\t
featuretree.txt
\t
1000
\t\t\t
8192
\t
1
\n
"
;
static
const
char
ft_comp_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
"
"comp
\t
{12345678-1234-1234-1234-222222222222}
\t
TARGETDIR
\t
0
\t\t\n
"
"comp2
\t
{12345678-1234-1234-1234-333333333333}
\t
TARGETDIR
\t
0
\t\t
featuretree
\n
"
;
static
const
char
ft_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
"
"A
\t\t\t\t
2
\t
1
\t\t
0
\n
"
"C
\t
B
\t\t\t
2
\t
1
\t\t
0
\n
"
"B
\t
A
\t\t\t
4
\t
1
\t\t
0
\n
"
"D
\t\t\t\t
2
\t
1
\t\t
0
\n
"
;
static
const
char
ft_feature_comp_dat
[]
=
"Feature_
\t
Component_
\n
"
"s38
\t
s72
\n
"
"FeatureComponents
\t
Feature_
\t
Component_
\n
"
"C
\t
comp
\n
"
"D
\t
comp2
\n
"
;
static
const
char
ft_condition_dat
[]
=
"Feature_
\t
Level
\t
Condition
\n
"
"s38
\t
i2
\t
S255
\n
"
"Condition
\t
Feature_
\t
Level
\n
"
"A
\t
0
\t\"
0
\"
<>INSTALLTYPE
\n
"
;
static
const
char
ft_custom_action_dat
[]
=
"Action
\t
Type
\t
Source
\t
Target
\t
ISComments
\n
"
"s72
\t
i2
\t
S64
\t
S0
\t
S255
\n
"
"CustomAction
\t
Action
\n
"
"Run A
\t
19
\t\t
A
\t\n
"
"Run B
\t
19
\t\t
B
\t\n
"
"Run C
\t
19
\t\t
C
\t\n
"
;
static
const
char
ft_install_exec_seq_dat
[]
=
"Action
\t
Condition
\t
Sequence
\n
"
"s72
\t
S255
\t
I2
\n
"
"InstallExecuteSequence
\t
Action
\n
"
"CostInitialize
\t\t
100
\n
"
"FileCost
\t\t
200
\n
"
"CostFinalize
\t\t
300
\n
"
"InstallValidate
\t\t
400
\n
"
"InstallInitialize
\t\t
500
\n
"
"Run C
\t
3 = &C AND NOT Installed
\t
600
\n
"
"Run B
\t
3 = &B AND NOT Installed
\t
700
\n
"
"Run A
\t
3 = &A AND NOT Installed
\t
800
\n
"
"ProcessComponents
\t\t
900
\n
"
"RemoveFiles
\t\t
1000
\n
"
"InstallFiles
\t\t
1100
\n
"
"RegisterProduct
\t\t
1200
\n
"
"PublishFeatures
\t\t
1300
\n
"
"PublishProduct
\t\t
1400
\n
"
"InstallFinalize
\t\t
1500
\n
"
;
typedef
struct
_msi_table
{
const
CHAR
*
filename
;
...
...
@@ -1862,6 +1925,20 @@ static const msi_table shc2_tables[] =
ADD_TABLE
(
shc2_property
)
};
static
const
msi_table
ft_tables
[]
=
{
ADD_TABLE
(
media
),
ADD_TABLE
(
directory
),
ADD_TABLE
(
ft_file
),
ADD_TABLE
(
ft_comp
),
ADD_TABLE
(
ft_feature
),
ADD_TABLE
(
ft_feature_comp
),
ADD_TABLE
(
ft_condition
),
ADD_TABLE
(
ft_custom_action
),
ADD_TABLE
(
ft_install_exec_seq
),
ADD_TABLE
(
property
)
};
/* cabinet definitions */
/* make the max size large so there is only one cab file */
...
...
@@ -5939,6 +6016,35 @@ static void test_remove_upgrade_code(void)
DeleteFileA
(
msifile
);
}
static
void
test_feature_tree
(
void
)
{
UINT
r
;
if
(
is_process_limited
())
{
skip
(
"process is limited
\n
"
);
return
;
}
create_file
(
"msitest
\\
featuretree.txt"
,
1000
);
create_database
(
msifile
,
ft_tables
,
sizeof
(
ft_tables
)
/
sizeof
(
ft_tables
[
0
])
);
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
r
=
MsiInstallProductA
(
msifile
,
"INSTALLTYPE=
\"
0
\"
"
);
ok
(
r
==
ERROR_INSTALL_FAILURE
,
"got %u
\n
"
,
r
);
r
=
MsiInstallProductA
(
msifile
,
"INSTALLTYPE=
\"
1
\"
"
);
ok
(
r
==
ERROR_SUCCESS
,
"got %u
\n
"
,
r
);
r
=
MsiInstallProductA
(
msifile
,
"REMOVE=ALL"
);
ok
(
r
==
ERROR_SUCCESS
,
"got %u
\n
"
,
r
);
DeleteFileA
(
"msitest
\\
featuretree.txt"
);
RemoveDirectoryA
(
"msitest"
);
DeleteFileA
(
msifile
);
}
START_TEST
(
install
)
{
DWORD
len
;
...
...
@@ -6026,6 +6132,7 @@ START_TEST(install)
test_volume_props
();
test_shared_component
();
test_remove_upgrade_code
();
test_feature_tree
();
DeleteFileA
(
log_file
);
...
...
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