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
e16bcda4
Commit
e16bcda4
authored
May 31, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
May 31, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Don't create empty values for special registry entries.
parent
c959e386
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
25 deletions
+36
-25
action.c
dlls/msi/action.c
+27
-22
action.c
dlls/msi/tests/action.c
+9
-3
No files found.
dlls/msi/action.c
View file @
e16bcda4
...
...
@@ -2578,6 +2578,11 @@ static WCHAR *get_keypath( MSIPACKAGE *package, HKEY root, const WCHAR *path )
return
strdupW
(
path
);
}
static
BOOL
is_special_entry
(
const
WCHAR
*
name
,
const
WCHAR
*
value
)
{
return
(
name
&&
(
name
[
0
]
==
'*'
||
name
[
0
]
==
'+'
)
&&
!
name
[
1
]
&&
!
value
);
}
static
UINT
ITERATE_WriteRegistryValues
(
MSIRECORD
*
row
,
LPVOID
param
)
{
MSIPACKAGE
*
package
=
param
;
...
...
@@ -2612,10 +2617,8 @@ static UINT ITERATE_WriteRegistryValues(MSIRECORD *row, LPVOID param)
/* null values can have special meanings */
if
(
name
[
0
]
==
'-'
&&
name
[
1
]
==
0
)
return
ERROR_SUCCESS
;
else
if
((
name
[
0
]
==
'+'
&&
name
[
1
]
==
0
)
||
(
name
[
0
]
==
'*'
&&
name
[
1
]
==
0
))
name
=
NULL
;
check_first
=
TRUE
;
if
((
name
[
0
]
==
'+'
||
name
[
0
]
==
'*'
)
&&
!
name
[
1
])
check_first
=
TRUE
;
}
root
=
MSI_RecordGetInteger
(
row
,
2
);
...
...
@@ -2652,28 +2655,30 @@ static UINT ITERATE_WriteRegistryValues(MSIRECORD *row, LPVOID param)
}
deformat_string
(
package
,
name
,
&
deformated
);
if
(
!
check_first
)
{
TRACE
(
"Setting value %s of %s
\n
"
,
debugstr_w
(
deformated
),
debugstr_w
(
uikey
));
RegSetValueExW
(
hkey
,
deformated
,
0
,
type
,
(
LPBYTE
)
value_data
,
size
);
}
else
if
(
!
is_special_entry
(
name
,
value
))
{
DWORD
sz
=
0
;
rc
=
RegQueryValueExW
(
hkey
,
deformated
,
NULL
,
NULL
,
NULL
,
&
sz
);
if
(
rc
==
ERROR_SUCCESS
||
rc
==
ERROR_MORE_DATA
)
if
(
!
check_first
)
{
TRACE
(
"value %s of %s checked already exists
\n
"
,
debugstr_w
(
deformated
),
debugstr_w
(
uikey
));
TRACE
(
"Setting value %s of %s
\n
"
,
debugstr_w
(
deformated
),
debugstr_w
(
uikey
));
RegSetValueExW
(
hkey
,
deformated
,
0
,
type
,
(
LPBYTE
)
value_data
,
size
);
}
else
{
TRACE
(
"Checked and setting value %s of %s
\n
"
,
debugstr_w
(
deformated
),
debugstr_w
(
uikey
));
if
(
deformated
||
size
)
RegSetValueExW
(
hkey
,
deformated
,
0
,
type
,
(
LPBYTE
)
value_data
,
size
);
DWORD
sz
=
0
;
rc
=
RegQueryValueExW
(
hkey
,
deformated
,
NULL
,
NULL
,
NULL
,
&
sz
);
if
(
rc
==
ERROR_SUCCESS
||
rc
==
ERROR_MORE_DATA
)
{
TRACE
(
"value %s of %s checked already exists
\n
"
,
debugstr_w
(
deformated
),
debugstr_w
(
uikey
));
}
else
{
TRACE
(
"Checked and setting value %s of %s
\n
"
,
debugstr_w
(
deformated
),
debugstr_w
(
uikey
));
if
(
deformated
||
size
)
RegSetValueExW
(
hkey
,
deformated
,
0
,
type
,
(
LPBYTE
)
value_data
,
size
);
}
}
}
RegCloseKey
(
hkey
);
...
...
@@ -2773,7 +2778,7 @@ static UINT ITERATE_RemoveRegistryValuesOnUninstall( MSIRECORD *row, LPVOID para
{
if
(
name
[
0
]
==
'+'
&&
!
name
[
1
])
return
ERROR_SUCCESS
;
else
if
((
name
[
0
]
==
'-'
&&
!
name
[
1
])
||
(
name
[
0
]
==
'*'
&&
!
name
[
1
])
)
if
((
name
[
0
]
==
'-'
||
name
[
0
]
==
'*'
)
&&
!
name
[
1
]
)
{
delete_key
=
TRUE
;
name
=
NULL
;
...
...
dlls/msi/tests/action.c
View file @
e16bcda4
...
...
@@ -487,7 +487,10 @@ static const char wrv_registry_dat[] =
"Registry
\t
Root
\t
Key
\t
Name
\t
Value
\t
Component_
\n
"
"s72
\t
i2
\t
l255
\t
L255
\t
L0
\t
s72
\n
"
"Registry
\t
Registry
\n
"
"regdata
\t
2
\t
SOFTWARE
\\
Wine
\\
msitest
\t
Value
\t
[~]one[~]two[~]three
\t
augustus"
;
"regdata
\t
2
\t
SOFTWARE
\\
Wine
\\
msitest
\t
Value
\t
[~]one[~]two[~]three
\t
augustus
\n
"
"regdata1
\t
2
\t
SOFTWARE
\\
Wine
\\
msitest
\t
*
\t\t
augustus
\n
"
"regdata2
\t
2
\t
SOFTWARE
\\
Wine
\\
msitest
\t
*
\t
#%
\t
augustus
\n
"
"regdata3
\t
2
\t
SOFTWARE
\\
Wine
\\
msitest
\t
*
\t
#x
\t
augustus
\n
"
;
static
const
char
cf_directory_dat
[]
=
"Directory
\t
Directory_Parent
\t
DefaultDir
\n
"
...
...
@@ -4572,7 +4575,7 @@ static void test_write_registry_values(void)
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
size
=
MAX_PATH
;
type
=
REG_MULTI_SZ
;
type
=
0xdeadbeef
;
memset
(
path
,
'a'
,
MAX_PATH
);
res
=
RegQueryValueExA
(
hkey
,
"Value"
,
NULL
,
&
type
,
(
LPBYTE
)
path
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -4580,9 +4583,12 @@ static void test_write_registry_values(void)
ok
(
size
==
15
,
"Expected 15, got %d
\n
"
,
size
);
ok
(
type
==
REG_MULTI_SZ
,
"Expected REG_MULTI_SZ, got %d
\n
"
,
type
);
res
=
RegQueryValueExA
(
hkey
,
""
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
res
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
res
);
RegDeleteValueA
(
hkey
,
"Value"
);
RegCloseKey
(
hkey
);
RegDeleteKeyA
(
HKEY_
CURRENT_USER
,
"SOFTWARE
\\
Wine
\\
msitest"
);
RegDeleteKeyA
(
HKEY_
LOCAL_MACHINE
,
"SOFTWARE
\\
Wine
\\
msitest"
);
error:
DeleteFile
(
msifile
);
...
...
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