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
959ebdb1
Commit
959ebdb1
authored
Dec 01, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
Dec 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Split up delete_reg_key_or_value.
parent
5683433f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
17 deletions
+15
-17
action.c
dlls/msi/action.c
+15
-17
No files found.
dlls/msi/action.c
View file @
959ebdb1
...
...
@@ -2689,40 +2689,36 @@ static UINT ACTION_WriteRegistryValues(MSIPACKAGE *package)
return
rc
;
}
static
void
delete_reg_
key_or_value
(
HKEY
hkey_root
,
LPCWSTR
key
,
LPCWSTR
value
,
BOOL
delete_key
)
static
void
delete_reg_
value
(
HKEY
root
,
const
WCHAR
*
keypath
,
const
WCHAR
*
value
)
{
LONG
res
;
HKEY
hkey
;
DWORD
num_subkeys
,
num_values
;
if
(
delete_key
)
{
if
((
res
=
RegDeleteTreeW
(
hkey_root
,
key
)))
{
TRACE
(
"Failed to delete key %s (%d)
\n
"
,
debugstr_w
(
key
),
res
);
}
return
;
}
if
(
!
(
res
=
RegOpenKeyW
(
hkey_root
,
key
,
&
hkey
)))
if
(
!
(
res
=
RegOpenKeyW
(
root
,
keypath
,
&
hkey
)))
{
if
((
res
=
RegDeleteValueW
(
hkey
,
value
)))
{
TRACE
(
"
F
ailed to delete value %s (%d)
\n
"
,
debugstr_w
(
value
),
res
);
TRACE
(
"
f
ailed to delete value %s (%d)
\n
"
,
debugstr_w
(
value
),
res
);
}
res
=
RegQueryInfoKeyW
(
hkey
,
NULL
,
NULL
,
NULL
,
&
num_subkeys
,
NULL
,
NULL
,
&
num_values
,
NULL
,
NULL
,
NULL
,
NULL
);
RegCloseKey
(
hkey
);
if
(
!
res
&&
!
num_subkeys
&&
!
num_values
)
{
TRACE
(
"
Removing empty key %s
\n
"
,
debugstr_w
(
key
));
RegDeleteKeyW
(
hkey_root
,
key
);
TRACE
(
"
removing empty key %s
\n
"
,
debugstr_w
(
keypath
));
RegDeleteKeyW
(
root
,
keypath
);
}
return
;
}
TRACE
(
"
Failed to open key %s (%d)
\n
"
,
debugstr_w
(
key
),
res
);
TRACE
(
"
failed to open key %s (%d)
\n
"
,
debugstr_w
(
keypath
),
res
);
}
static
void
delete_reg_key
(
HKEY
root
,
const
WCHAR
*
keypath
)
{
LONG
res
=
RegDeleteTreeW
(
root
,
keypath
);
if
(
res
)
TRACE
(
"failed to delete key %s (%d)
\n
"
,
debugstr_w
(
keypath
),
res
);
}
static
UINT
ITERATE_RemoveRegistryValuesOnUninstall
(
MSIRECORD
*
row
,
LPVOID
param
)
{
...
...
@@ -2779,7 +2775,8 @@ static UINT ITERATE_RemoveRegistryValuesOnUninstall( MSIRECORD *row, LPVOID para
keypath
=
get_keypath
(
package
,
hkey_root
,
deformated_key
);
msi_free
(
deformated_key
);
delete_reg_key_or_value
(
hkey_root
,
keypath
,
deformated_name
,
delete_key
);
if
(
delete_key
)
delete_reg_key
(
hkey_root
,
keypath
);
else
delete_reg_value
(
hkey_root
,
keypath
,
deformated_name
);
msi_free
(
keypath
);
uirow
=
MSI_CreateRecord
(
2
);
...
...
@@ -2843,7 +2840,8 @@ static UINT ITERATE_RemoveRegistryValuesOnInstall( MSIRECORD *row, LPVOID param
keypath
=
get_keypath
(
package
,
hkey_root
,
deformated_key
);
msi_free
(
deformated_key
);
delete_reg_key_or_value
(
hkey_root
,
keypath
,
deformated_name
,
delete_key
);
if
(
delete_key
)
delete_reg_key
(
hkey_root
,
keypath
);
else
delete_reg_value
(
hkey_root
,
keypath
,
deformated_name
);
msi_free
(
keypath
);
uirow
=
MSI_CreateRecord
(
2
);
...
...
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