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
b33b8cab
Commit
b33b8cab
authored
Nov 02, 2018
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Avoid duplicate product codes in FindRelatedProducts.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
21f44e8f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
27 deletions
+41
-27
upgrade.c
dlls/msi/upgrade.c
+41
-27
No files found.
dlls/msi/upgrade.c
View file @
b33b8cab
...
...
@@ -55,45 +55,59 @@ static BOOL check_language(DWORD lang1, LPCWSTR lang2, DWORD attributes)
return
(
lang1
==
langdword
);
}
static
void
append_productcode
(
MSIPACKAGE
*
package
,
LPCWSTR
action_property
,
LPCWSTR
productid
)
static
BOOL
find_product
(
const
WCHAR
*
list
,
const
WCHAR
*
product
)
{
LPWSTR
prop
;
LPWSTR
newprop
;
DWORD
len
;
UINT
r
;
prop
=
msi_dup_property
(
package
->
db
,
action_property
);
if
(
prop
)
len
=
strlenW
(
prop
);
else
len
=
0
;
const
WCHAR
*
p
=
list
,
*
q
;
/*separator*/
len
++
;
if
(
!
list
)
return
FALSE
;
for
(;;)
{
while
(
*
p
&&
*
p
!=
'{'
)
p
++
;
if
(
*
p
!=
'{'
)
return
FALSE
;
q
=
p
;
while
(
*
q
&&
*
q
!=
'}'
)
q
++
;
if
(
*
q
!=
'}'
)
return
FALSE
;
q
++
;
if
(
q
-
p
<
strlenW
(
product
))
return
FALSE
;
if
(
!
memcmp
(
p
,
product
,
(
q
-
p
)
*
sizeof
(
WCHAR
)
))
return
TRUE
;
p
=
q
+
1
;
while
(
*
p
&&
*
p
!=
';'
)
p
++
;
if
(
*
p
!=
';'
)
break
;
}
len
+=
strlenW
(
productid
);
return
FALSE
;
}
/*null*/
len
++
;
static
void
append_productcode
(
MSIPACKAGE
*
package
,
const
WCHAR
*
action_prop
,
const
WCHAR
*
product
)
{
WCHAR
*
prop
,
*
newprop
;
DWORD
len
=
0
;
UINT
r
;
newprop
=
msi_alloc
(
len
*
sizeof
(
WCHAR
)
);
prop
=
msi_dup_property
(
package
->
db
,
action_prop
);
if
(
find_product
(
prop
,
product
))
{
TRACE
(
"related product property %s already contains %s
\n
"
,
debugstr_w
(
action_prop
),
debugstr_w
(
product
)
);
msi_free
(
prop
);
return
;
}
if
(
prop
)
len
+=
strlenW
(
prop
);
len
+=
strlenW
(
product
)
+
2
;
if
(
!
(
newprop
=
msi_alloc
(
len
*
sizeof
(
WCHAR
)
)))
return
;
if
(
prop
)
{
strcpyW
(
newprop
,
prop
);
strcatW
(
newprop
,
szSemiColon
);
strcpyW
(
newprop
,
prop
);
strcatW
(
newprop
,
szSemiColon
);
}
else
newprop
[
0
]
=
0
;
strcatW
(
newprop
,
productid
);
else
newprop
[
0
]
=
0
;
strcatW
(
newprop
,
product
);
r
=
msi_set_property
(
package
->
db
,
action_prop
erty
,
newprop
,
-
1
);
if
(
r
==
ERROR_SUCCESS
&&
!
strcmpW
(
action_prop
erty
,
szSourceDir
))
r
=
msi_set_property
(
package
->
db
,
action_prop
,
newprop
,
-
1
);
if
(
r
==
ERROR_SUCCESS
&&
!
strcmpW
(
action_prop
,
szSourceDir
))
msi_reset_source_folders
(
package
);
TRACE
(
"Found Related Product... %s now %s
\n
"
,
debugstr_w
(
action_property
),
debugstr_w
(
newprop
));
TRACE
(
"related product property %s now %s
\n
"
,
debugstr_w
(
action_prop
),
debugstr_w
(
newprop
)
);
msi_free
(
prop
);
msi_free
(
newprop
);
...
...
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