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
03282df1
Commit
03282df1
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: Use the quoted part of the registry value when searching for a file or directory.
parent
6df69c6a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
2 deletions
+53
-2
appsearch.c
dlls/msi/appsearch.c
+8
-2
package.c
dlls/msi/tests/package.c
+45
-0
No files found.
dlls/msi/appsearch.c
View file @
03282df1
...
...
@@ -372,6 +372,7 @@ static UINT ACTION_AppSearchReg(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNAT
'S'
,
'i'
,
'g'
,
'n'
,
'a'
,
't'
,
'u'
,
'r'
,
'e'
,
'_'
,
' '
,
'='
,
' '
,
'\''
,
'%'
,
's'
,
'\''
,
0
};
LPWSTR
keyPath
=
NULL
,
valueName
=
NULL
;
LPWSTR
deformatted
=
NULL
;
LPWSTR
ptr
=
NULL
,
end
;
int
root
,
type
;
HKEY
rootKey
,
key
=
NULL
;
DWORD
sz
=
0
,
regType
;
...
...
@@ -444,13 +445,18 @@ static UINT ACTION_AppSearchReg(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNAT
if
(
sz
==
0
)
goto
end
;
if
((
ptr
=
strchrW
((
LPWSTR
)
value
,
'"'
))
&&
(
end
=
strchrW
(
++
ptr
,
'"'
)))
*
end
=
'\0'
;
else
ptr
=
(
LPWSTR
)
value
;
switch
(
type
&
0x0f
)
{
case
msidbLocatorTypeDirectory
:
rc
=
ACTION_SearchDirectory
(
package
,
sig
,
(
LPWSTR
)
value
,
0
,
appValue
);
rc
=
ACTION_SearchDirectory
(
package
,
sig
,
ptr
,
0
,
appValue
);
break
;
case
msidbLocatorTypeFileName
:
*
appValue
=
app_search_file
(
(
LPWSTR
)
value
,
sig
);
*
appValue
=
app_search_file
(
ptr
,
sig
);
break
;
case
msidbLocatorTypeRawValue
:
ACTION_ConvertRegValue
(
regType
,
value
,
sz
,
appValue
);
...
...
dlls/msi/tests/package.c
View file @
03282df1
...
...
@@ -6254,6 +6254,14 @@ static void test_appsearch_reglocator(void)
(
const
BYTE
*
)
path
,
lstrlenA
(
path
)
+
1
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
sprintf
(
path
,
"
\"
%s
\\
FileName1
\"
-option"
,
CURR_DIR
);
res
=
RegSetValueExA
(
hklm
,
"value16"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
path
,
lstrlenA
(
path
)
+
1
);
sprintf
(
path
,
"%s
\\
FileName1 -option"
,
CURR_DIR
);
res
=
RegSetValueExA
(
hklm
,
"value17"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
path
,
lstrlenA
(
path
)
+
1
);
hdb
=
create_package_db
();
ok
(
hdb
,
"Expected a valid database handle
\n
"
);
...
...
@@ -6344,6 +6352,12 @@ static void test_appsearch_reglocator(void)
r
=
add_appsearch_entry
(
hdb
,
"'SIGPROP28', 'NewSignature28'"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
add_appsearch_entry
(
hdb
,
"'SIGPROP29', 'NewSignature29'"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
add_appsearch_entry
(
hdb
,
"'SIGPROP30', 'NewSignature30'"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
create_reglocator_table
(
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
...
...
@@ -6487,6 +6501,16 @@ static void test_appsearch_reglocator(void)
r
=
add_reglocator_entry
(
hdb
,
str
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
/* HKLM, msidbLocatorTypeFile, file exists, in quotes */
str
=
"'NewSignature29', 2, 'Software
\\
Wine', 'Value16', 1"
;
r
=
add_reglocator_entry
(
hdb
,
str
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
/* HKLM, msidbLocatorTypeFile, file exists, no quotes */
str
=
"'NewSignature30', 2, 'Software
\\
Wine', 'Value17', 1"
;
r
=
add_reglocator_entry
(
hdb
,
str
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
create_signature_table
(
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
...
...
@@ -6523,6 +6547,14 @@ static void test_appsearch_reglocator(void)
r
=
add_signature_entry
(
hdb
,
str
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
str
=
"'NewSignature29', 'FileName1', '', '', '', '', '', '', ''"
;
r
=
add_signature_entry
(
hdb
,
str
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
str
=
"'NewSignature30', 'FileName1', '', '', '', '', '', '', ''"
;
r
=
add_signature_entry
(
hdb
,
str
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
hpkg
=
package_from_db
(
hdb
);
ok
(
hpkg
,
"Expected a valid package handle
\n
"
);
...
...
@@ -6692,6 +6724,17 @@ static void test_appsearch_reglocator(void)
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
prop
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
prop
);
size
=
MAX_PATH
;
sprintf
(
path
,
"%s
\\
FileName1"
,
CURR_DIR
);
r
=
MsiGetPropertyA
(
hpkg
,
"SIGPROP29"
,
prop
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
prop
,
path
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
path
,
prop
);
size
=
MAX_PATH
;
r
=
MsiGetPropertyA
(
hpkg
,
"SIGPROP30"
,
prop
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
prop
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
prop
);
RegSetValueA
(
hklm
,
NULL
,
REG_SZ
,
""
,
0
);
RegDeleteValueA
(
hklm
,
"Value1"
);
RegDeleteValueA
(
hklm
,
"Value2"
);
...
...
@@ -6708,6 +6751,8 @@ static void test_appsearch_reglocator(void)
RegDeleteValueA
(
hklm
,
"Value13"
);
RegDeleteValueA
(
hklm
,
"Value14"
);
RegDeleteValueA
(
hklm
,
"Value15"
);
RegDeleteValueA
(
hklm
,
"Value16"
);
RegDeleteValueA
(
hklm
,
"Value17"
);
RegDeleteKeyA
(
hklm
,
""
);
RegCloseKey
(
hklm
);
...
...
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