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
70225a4d
Commit
70225a4d
authored
Apr 30, 2014
by
Jérôme Gardou
Committed by
Alexandre Julliard
May 01, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Expand REG_EXPAND_SZ keys when resolving AppSearch entries.
parent
95d72ae6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
appsearch.c
dlls/msi/appsearch.c
+13
-0
package.c
dlls/msi/tests/package.c
+22
-0
No files found.
dlls/msi/appsearch.c
View file @
70225a4d
...
@@ -451,6 +451,19 @@ static UINT ACTION_AppSearchReg(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNAT
...
@@ -451,6 +451,19 @@ static UINT ACTION_AppSearchReg(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNAT
if
(
sz
==
0
)
if
(
sz
==
0
)
goto
end
;
goto
end
;
/* expand if needed */
if
(
regType
==
REG_EXPAND_SZ
)
{
sz
=
ExpandEnvironmentStringsW
((
LPCWSTR
)
value
,
NULL
,
0
);
if
(
sz
)
{
LPWSTR
buf
=
msi_alloc
(
sz
*
sizeof
(
WCHAR
));
ExpandEnvironmentStringsW
((
LPCWSTR
)
value
,
buf
,
sz
);
msi_free
(
value
);
value
=
(
LPBYTE
)
buf
;
}
}
if
((
regType
==
REG_SZ
||
regType
==
REG_EXPAND_SZ
)
&&
if
((
regType
==
REG_SZ
||
regType
==
REG_EXPAND_SZ
)
&&
(
ptr
=
strchrW
((
LPWSTR
)
value
,
'"'
))
&&
(
end
=
strchrW
(
++
ptr
,
'"'
)))
(
ptr
=
strchrW
((
LPWSTR
)
value
,
'"'
))
&&
(
end
=
strchrW
(
++
ptr
,
'"'
)))
*
end
=
'\0'
;
*
end
=
'\0'
;
...
...
dlls/msi/tests/package.c
View file @
70225a4d
...
@@ -3689,6 +3689,8 @@ static void test_appsearch(void)
...
@@ -3689,6 +3689,8 @@ static void test_appsearch(void)
MSIHANDLE
hdb
;
MSIHANDLE
hdb
;
CHAR
prop
[
MAX_PATH
];
CHAR
prop
[
MAX_PATH
];
DWORD
size
;
DWORD
size
;
HKEY
hkey
;
const
char
reg_expand_value
[]
=
"%systemroot%
\\
system32
\\
notepad.exe"
;
hdb
=
create_package_db
();
hdb
=
create_package_db
();
ok
(
hdb
,
"failed to create package database
\n
"
);
ok
(
hdb
,
"failed to create package database
\n
"
);
...
@@ -3702,12 +3704,23 @@ static void test_appsearch(void)
...
@@ -3702,12 +3704,23 @@ static void test_appsearch(void)
r
=
add_appsearch_entry
(
hdb
,
"'NOTEPAD', 'NewSignature2'"
);
r
=
add_appsearch_entry
(
hdb
,
"'NOTEPAD', 'NewSignature2'"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add entry: %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add entry: %d
\n
"
,
r
);
r
=
add_appsearch_entry
(
hdb
,
"'REGEXPANDVAL', 'NewSignature3'"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add entry: %d
\n
"
,
r
);
r
=
create_reglocator_table
(
hdb
);
r
=
create_reglocator_table
(
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot create RegLocator table: %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot create RegLocator table: %d
\n
"
,
r
);
r
=
add_reglocator_entry
(
hdb
,
"NewSignature1"
,
0
,
"htmlfile
\\
shell
\\
open
\\
command"
,
""
,
1
);
r
=
add_reglocator_entry
(
hdb
,
"NewSignature1"
,
0
,
"htmlfile
\\
shell
\\
open
\\
command"
,
""
,
1
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot create RegLocator table: %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot create RegLocator table: %d
\n
"
,
r
);
r
=
RegCreateKeyExA
(
HKEY_CURRENT_USER
,
"Software
\\
Winetest_msi"
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
&
hkey
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"Could not create key: %d.
\n
"
,
r
);
r
=
RegSetValueExA
(
hkey
,
NULL
,
0
,
REG_EXPAND_SZ
,
(
const
BYTE
*
)
reg_expand_value
,
strlen
(
reg_expand_value
)
+
1
);
ok
(
r
==
ERROR_SUCCESS
,
"Could not set key value: %d.
\n
"
,
r
);
RegCloseKey
(
hkey
);
r
=
add_reglocator_entry
(
hdb
,
"NewSignature3"
,
1
,
"Software
\\
Winetest_msi"
,
""
,
1
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot create RegLocator table: %d
\n
"
,
r
);
r
=
create_drlocator_table
(
hdb
);
r
=
create_drlocator_table
(
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot create DrLocator table: %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot create DrLocator table: %d
\n
"
,
r
);
...
@@ -3723,6 +3736,9 @@ static void test_appsearch(void)
...
@@ -3723,6 +3736,9 @@ static void test_appsearch(void)
r
=
add_signature_entry
(
hdb
,
"'NewSignature2', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''"
);
r
=
add_signature_entry
(
hdb
,
"'NewSignature2', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add signature: %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add signature: %d
\n
"
,
r
);
r
=
add_signature_entry
(
hdb
,
"'NewSignature3', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add signature: %d
\n
"
,
r
);
r
=
package_from_db
(
hdb
,
&
hpkg
);
r
=
package_from_db
(
hdb
,
&
hpkg
);
if
(
r
==
ERROR_INSTALL_PACKAGE_REJECTED
)
if
(
r
==
ERROR_INSTALL_PACKAGE_REJECTED
)
{
{
...
@@ -3749,9 +3765,15 @@ static void test_appsearch(void)
...
@@ -3749,9 +3765,15 @@ static void test_appsearch(void)
r
=
MsiGetPropertyA
(
hpkg
,
"NOTEPAD"
,
prop
,
&
size
);
r
=
MsiGetPropertyA
(
hpkg
,
"NOTEPAD"
,
prop
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"get property failed: %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"get property failed: %d
\n
"
,
r
);
size
=
sizeof
(
prop
);
r
=
MsiGetPropertyA
(
hpkg
,
"REGEXPANDVAL"
,
prop
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"get property failed: %d
\n
"
,
r
);
ok
(
lstrlenA
(
prop
)
!=
0
,
"Expected non-zero length
\n
"
);
done:
done:
MsiCloseHandle
(
hpkg
);
MsiCloseHandle
(
hpkg
);
DeleteFileA
(
msifile
);
DeleteFileA
(
msifile
);
RegDeleteKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Winetest_msi"
);
}
}
static
void
test_appsearch_complocator
(
void
)
static
void
test_appsearch_complocator
(
void
)
...
...
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