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
859bd01b
Commit
859bd01b
authored
Oct 20, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Oct 20, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Check the file version when a version is provided in the signature.
parent
fbba2e8b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
28 deletions
+67
-28
appsearch.c
dlls/msi/appsearch.c
+57
-3
package.c
dlls/msi/tests/package.c
+10
-25
No files found.
dlls/msi/appsearch.c
View file @
859bd01b
...
...
@@ -155,6 +155,60 @@ static void ACTION_FreeSignature(MSISIGNATURE *sig)
msi_free
(
sig
->
Languages
);
}
static
LPWSTR
app_search_file
(
LPWSTR
path
,
MSISIGNATURE
*
sig
)
{
VS_FIXEDFILEINFO
*
info
;
DWORD
attr
,
handle
,
size
;
LPWSTR
val
=
NULL
;
LPBYTE
buffer
;
static
const
WCHAR
root
[]
=
{
'\\'
,
0
};
attr
=
GetFileAttributesW
(
path
);
if
(
attr
==
INVALID_FILE_ATTRIBUTES
||
attr
==
FILE_ATTRIBUTE_DIRECTORY
)
return
NULL
;
size
=
GetFileVersionInfoSizeW
(
path
,
&
handle
);
if
(
!
size
)
return
strdupW
(
path
);
buffer
=
msi_alloc
(
size
);
if
(
!
buffer
)
return
NULL
;
if
(
!
GetFileVersionInfoW
(
path
,
0
,
size
,
buffer
))
goto
done
;
if
(
!
VerQueryValueW
(
buffer
,
root
,
(
LPVOID
)
&
info
,
&
size
)
||
!
info
)
goto
done
;
if
(
sig
->
MinVersionLS
||
sig
->
MinVersionMS
)
{
if
(
info
->
dwFileVersionMS
<
sig
->
MinVersionMS
)
goto
done
;
if
(
info
->
dwFileVersionMS
==
sig
->
MinVersionMS
&&
info
->
dwFileVersionLS
<
sig
->
MinVersionLS
)
goto
done
;
}
if
(
sig
->
MaxVersionLS
||
sig
->
MaxVersionMS
)
{
if
(
info
->
dwFileVersionMS
>
sig
->
MaxVersionMS
)
goto
done
;
if
(
info
->
dwFileVersionMS
==
sig
->
MaxVersionMS
&&
info
->
dwFileVersionLS
>
sig
->
MaxVersionLS
)
goto
done
;
}
val
=
strdupW
(
path
);
done:
msi_free
(
buffer
);
return
val
;
}
static
UINT
ACTION_AppSearchComponents
(
MSIPACKAGE
*
package
,
LPWSTR
*
appValue
,
MSISIGNATURE
*
sig
)
{
static
const
WCHAR
query
[]
=
{
...
...
@@ -211,7 +265,7 @@ static UINT ACTION_AppSearchComponents(MSIPACKAGE *package, LPWSTR *appValue, MS
if
(
type
!=
msidbLocatorTypeDirectory
&&
sigpresent
&&
!
isdir
)
{
*
appValue
=
strdupW
(
path
);
*
appValue
=
app_search_file
(
path
,
sig
);
}
else
if
(
!
sigpresent
&&
(
type
!=
msidbLocatorTypeDirectory
||
isdir
))
{
...
...
@@ -383,7 +437,7 @@ static UINT ACTION_AppSearchReg(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNAT
rc
=
ACTION_SearchDirectory
(
package
,
sig
,
(
LPWSTR
)
value
,
0
,
appValue
);
break
;
case
msidbLocatorTypeFileName
:
*
appValue
=
strdupW
((
LPWSTR
)
value
);
*
appValue
=
app_search_file
((
LPWSTR
)
value
,
sig
);
break
;
case
msidbLocatorTypeRawValue
:
ACTION_ConvertRegValue
(
regType
,
value
,
sz
,
appValue
);
...
...
@@ -475,7 +529,7 @@ static UINT ACTION_AppSearchIni(MSIPACKAGE *package, LPWSTR *appValue,
FIXME
(
"unimplemented for Directory (%s)
\n
"
,
debugstr_w
(
buf
));
break
;
case
msidbLocatorTypeFileName
:
FIXME
(
"unimplemented for File (%s)
\n
"
,
debugstr_w
(
buf
)
);
*
appValue
=
app_search_file
(
buf
,
sig
);
break
;
case
msidbLocatorTypeRawValue
:
*
appValue
=
get_ini_field
(
buf
,
field
);
...
...
dlls/msi/tests/package.c
View file @
859bd01b
...
...
@@ -5840,7 +5840,10 @@ static void test_appsearch(void)
r
=
MsiGetPropertyA
(
hpkg
,
"WEBBROWSERPROG"
,
prop
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"get property failed: %d
\n
"
,
r
);
ok
(
lstrlenA
(
prop
)
!=
0
,
"Expected non-zero length
\n
"
);
todo_wine
{
ok
(
lstrlenA
(
prop
)
!=
0
,
"Expected non-zero length
\n
"
);
}
MsiCloseHandle
(
hpkg
);
DeleteFileA
(
msifile
);
...
...
@@ -6093,10 +6096,7 @@ static void test_appsearch_complocator(void)
size
=
MAX_PATH
;
r
=
MsiGetPropertyA
(
hpkg
,
"SIGPROP11"
,
prop
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmpA
(
prop
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
prop
);
}
ok
(
!
lstrcmpA
(
prop
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
prop
);
size
=
MAX_PATH
;
sprintf
(
path
,
"%s
\\
FileName10.dll"
,
CURR_DIR
);
...
...
@@ -6538,10 +6538,7 @@ static void test_appsearch_reglocator(void)
size
=
MAX_PATH
;
r
=
MsiGetPropertyA
(
hpkg
,
"SIGPROP10"
,
prop
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmpA
(
prop
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
prop
);
}
ok
(
!
lstrcmpA
(
prop
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
prop
);
size
=
MAX_PATH
;
sprintf
(
path
,
"%s
\\
"
,
CURR_DIR
);
...
...
@@ -6611,10 +6608,7 @@ static void test_appsearch_reglocator(void)
size
=
MAX_PATH
;
r
=
MsiGetPropertyA
(
hpkg
,
"SIGPROP22"
,
prop
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmpA
(
prop
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
prop
);
}
ok
(
!
lstrcmpA
(
prop
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
prop
);
size
=
MAX_PATH
;
sprintf
(
path
,
"%s
\\
FileName5.dll"
,
CURR_DIR
);
...
...
@@ -6854,10 +6848,7 @@ static void test_appsearch_inilocator(void)
sprintf
(
path
,
"%s
\\
FileName1"
,
CURR_DIR
);
r
=
MsiGetPropertyA
(
hpkg
,
"SIGPROP4"
,
prop
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmpA
(
prop
,
path
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
path
,
prop
);
}
ok
(
!
lstrcmpA
(
prop
,
path
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
path
,
prop
);
size
=
MAX_PATH
;
r
=
MsiGetPropertyA
(
hpkg
,
"SIGPROP5"
,
prop
,
&
size
);
...
...
@@ -6902,10 +6893,7 @@ static void test_appsearch_inilocator(void)
sprintf
(
path
,
"%s
\\
FileName2.dll"
,
CURR_DIR
);
r
=
MsiGetPropertyA
(
hpkg
,
"SIGPROP10"
,
prop
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmpA
(
prop
,
path
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
path
,
prop
);
}
ok
(
!
lstrcmpA
(
prop
,
path
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
path
,
prop
);
size
=
MAX_PATH
;
r
=
MsiGetPropertyA
(
hpkg
,
"SIGPROP11"
,
prop
,
&
size
);
...
...
@@ -6916,10 +6904,7 @@ static void test_appsearch_inilocator(void)
sprintf
(
path
,
"%s
\\
FileName4.dll"
,
CURR_DIR
);
r
=
MsiGetPropertyA
(
hpkg
,
"SIGPROP12"
,
prop
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmpA
(
prop
,
path
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
path
,
prop
);
}
ok
(
!
lstrcmpA
(
prop
,
path
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
path
,
prop
);
delete_win_ini
(
"IniFile.ini"
);
DeleteFileA
(
"FileName1"
);
...
...
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