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
c8bb3359
Commit
c8bb3359
authored
Apr 23, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 23, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Check supported languages in the AppSearch action.
parent
52f3d5be
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
37 deletions
+79
-37
appsearch.c
dlls/msi/appsearch.c
+77
-32
msi.c
dlls/msi/msi.c
+1
-5
msipriv.h
dlls/msi/msipriv.h
+1
-0
No files found.
dlls/msi/appsearch.c
View file @
c8bb3359
...
...
@@ -608,6 +608,65 @@ static void ACTION_ExpandAnyPath(MSIPACKAGE *package, WCHAR *src, WCHAR *dst,
msi_free
(
deformatted
);
}
static
LANGID
*
parse_languages
(
const
WCHAR
*
languages
,
DWORD
*
num_ids
)
{
UINT
i
,
count
=
1
;
WCHAR
*
str
=
strdupW
(
languages
),
*
p
,
*
q
;
LANGID
*
ret
;
if
(
!
str
)
return
NULL
;
for
(
p
=
q
=
str
;
(
q
=
strchrW
(
q
,
','
));
q
++
)
count
++
;
if
(
!
(
ret
=
msi_alloc
(
count
*
sizeof
(
LANGID
)
)))
{
msi_free
(
str
);
return
NULL
;
}
i
=
0
;
while
(
*
p
)
{
q
=
strchrW
(
p
,
','
);
if
(
q
)
*
q
=
0
;
ret
[
i
]
=
atoiW
(
p
);
if
(
!
q
)
break
;
p
=
q
+
1
;
i
++
;
}
msi_free
(
str
);
*
num_ids
=
count
;
return
ret
;
}
static
BOOL
match_languages
(
const
void
*
version
,
const
WCHAR
*
languages
)
{
struct
lang
{
USHORT
id
;
USHORT
codepage
;
}
*
lang
;
DWORD
len
,
num_ids
,
i
,
j
;
BOOL
found
=
FALSE
;
LANGID
*
ids
;
if
(
!
languages
||
!
languages
[
0
])
return
TRUE
;
if
(
!
VerQueryValueW
(
version
,
szLangResource
,
(
void
**
)
&
lang
,
&
len
))
return
FALSE
;
if
(
!
(
ids
=
parse_languages
(
languages
,
&
num_ids
)))
return
FALSE
;
for
(
i
=
0
;
i
<
num_ids
;
i
++
)
{
found
=
FALSE
;
for
(
j
=
0
;
j
<
len
/
sizeof
(
struct
lang
);
j
++
)
{
if
(
!
ids
[
i
]
||
ids
[
i
]
==
lang
[
j
].
id
)
found
=
TRUE
;
}
if
(
!
found
)
goto
done
;
}
done:
msi_free
(
ids
);
return
found
;
}
/* Sets *matches to whether the file (whose path is filePath) matches the
* versions set in sig.
* Return ERROR_SUCCESS in case of success (whether or not the file matches),
...
...
@@ -616,34 +675,22 @@ static void ACTION_ExpandAnyPath(MSIPACKAGE *package, WCHAR *src, WCHAR *dst,
static
UINT
ACTION_FileVersionMatches
(
const
MSISIGNATURE
*
sig
,
LPCWSTR
filePath
,
BOOL
*
matches
)
{
UINT
rc
=
ERROR_SUCCESS
;
UINT
len
;
void
*
version
;
VS_FIXEDFILEINFO
*
info
=
NULL
;
DWORD
zero
,
size
=
GetFileVersionInfoSizeW
(
filePath
,
&
zero
);
*
matches
=
FALSE
;
if
(
sig
->
Languages
)
{
FIXME
(
": need to check version for languages %s
\n
"
,
debugstr_w
(
sig
->
Languages
));
}
else
{
DWORD
zero
,
size
=
GetFileVersionInfoSizeW
(
filePath
,
&
zero
);
if
(
size
)
{
LPVOID
buf
=
msi_alloc
(
size
);
if
(
!
size
)
return
ERROR_SUCCESS
;
if
(
!
(
version
=
msi_alloc
(
size
)))
return
ERROR_OUTOFMEMORY
;
if
(
buf
)
{
UINT
versionLen
;
LPVOID
subBlock
=
NULL
;
if
(
GetFileVersionInfoW
(
filePath
,
0
,
size
,
version
))
VerQueryValueW
(
version
,
szBackSlash
,
(
void
**
)
&
info
,
&
len
);
if
(
GetFileVersionInfoW
(
filePath
,
0
,
size
,
buf
))
VerQueryValueW
(
buf
,
szBackSlash
,
&
subBlock
,
&
versionLen
);
if
(
subBlock
)
if
(
info
)
{
VS_FIXEDFILEINFO
*
info
=
subBlock
;
TRACE
(
"Comparing file version %d.%d.%d.%d:
\n
"
,
TRACE
(
"comparing file version %d.%d.%d.%d:
\n
"
,
HIWORD
(
info
->
dwFileVersionMS
),
LOWORD
(
info
->
dwFileVersionMS
),
HIWORD
(
info
->
dwFileVersionLS
),
...
...
@@ -652,7 +699,7 @@ static UINT ACTION_FileVersionMatches(const MSISIGNATURE *sig, LPCWSTR filePath,
||
(
info
->
dwFileVersionMS
==
sig
->
MinVersionMS
&&
info
->
dwFileVersionLS
<
sig
->
MinVersionLS
))
{
TRACE
(
"L
ess than minimum version %d.%d.%d.%d
\n
"
,
TRACE
(
"l
ess than minimum version %d.%d.%d.%d
\n
"
,
HIWORD
(
sig
->
MinVersionMS
),
LOWORD
(
sig
->
MinVersionMS
),
HIWORD
(
sig
->
MinVersionLS
),
...
...
@@ -663,22 +710,20 @@ static UINT ACTION_FileVersionMatches(const MSISIGNATURE *sig, LPCWSTR filePath,
(
info
->
dwFileVersionMS
==
sig
->
MaxVersionMS
&&
info
->
dwFileVersionLS
>
sig
->
MaxVersionLS
)))
{
TRACE
(
"G
reater than maximum version %d.%d.%d.%d
\n
"
,
TRACE
(
"g
reater than maximum version %d.%d.%d.%d
\n
"
,
HIWORD
(
sig
->
MaxVersionMS
),
LOWORD
(
sig
->
MaxVersionMS
),
HIWORD
(
sig
->
MaxVersionLS
),
LOWORD
(
sig
->
MaxVersionLS
));
}
else
*
matches
=
TRUE
;
}
msi_free
(
buf
);
}
else
rc
=
ERROR_OUTOFMEMORY
;
else
if
(
!
match_languages
(
version
,
sig
->
Languages
))
{
TRACE
(
"languages %s not supported
\n
"
,
debugstr_w
(
sig
->
Languages
));
}
else
*
matches
=
TRUE
;
}
return
rc
;
msi_free
(
version
);
return
ERROR_SUCCESS
;
}
/* Sets *matches to whether the file in findData matches that in sig.
...
...
dlls/msi/msi.c
View file @
c8bb3359
...
...
@@ -3133,11 +3133,7 @@ static UINT get_file_version( const WCHAR *path, WCHAR *verbuf, DWORD *verlen,
WCHAR
*
langbuf
,
DWORD
*
langlen
)
{
static
const
WCHAR
szVersionResource
[]
=
{
'\\'
,
0
};
static
const
WCHAR
szVersionFormat
[]
=
{
'%'
,
'd'
,
'.'
,
'%'
,
'd'
,
'.'
,
'%'
,
'd'
,
'.'
,
'%'
,
'd'
,
0
};
static
const
WCHAR
szLangResource
[]
=
{
'\\'
,
'V'
,
'a'
,
'r'
,
'F'
,
'i'
,
'l'
,
'e'
,
'I'
,
'n'
,
'f'
,
'o'
,
'\\'
,
'T'
,
'r'
,
'a'
,
'n'
,
's'
,
'l'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
szVersionFormat
[]
=
{
'%'
,
'd'
,
'.'
,
'%'
,
'd'
,
'.'
,
'%'
,
'd'
,
'.'
,
'%'
,
'd'
,
0
};
static
const
WCHAR
szLangFormat
[]
=
{
'%'
,
'd'
,
0
};
UINT
ret
=
ERROR_SUCCESS
;
DWORD
len
,
error
;
...
...
dlls/msi/msipriv.h
View file @
c8bb3359
...
...
@@ -1172,6 +1172,7 @@ static const WCHAR szAppDataFolder[] = {'A','p','p','D','a','t','a','F','o','l',
static
const
WCHAR
szRollbackDisabled
[]
=
{
'R'
,
'o'
,
'l'
,
'l'
,
'b'
,
'a'
,
'c'
,
'k'
,
'D'
,
'i'
,
's'
,
'a'
,
'b'
,
'l'
,
'e'
,
'd'
,
0
};
static
const
WCHAR
szName
[]
=
{
'N'
,
'a'
,
'm'
,
'e'
,
0
};
static
const
WCHAR
szData
[]
=
{
'D'
,
'a'
,
't'
,
'a'
,
0
};
static
const
WCHAR
szLangResource
[]
=
{
'\\'
,
'V'
,
'a'
,
'r'
,
'F'
,
'i'
,
'l'
,
'e'
,
'I'
,
'n'
,
'f'
,
'o'
,
'\\'
,
'T'
,
'r'
,
'a'
,
'n'
,
's'
,
'l'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
/* memory allocation macro functions */
static
void
*
msi_alloc
(
size_t
len
)
__WINE_ALLOC_SIZE
(
1
);
...
...
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