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
0c01c586
Commit
0c01c586
authored
Nov 03, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Nov 04, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Factor out the code to open the features key.
parent
70be1e77
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
77 deletions
+49
-77
action.c
dlls/msi/action.c
+5
-8
msi.c
dlls/msi/msi.c
+6
-3
msipriv.h
dlls/msi/msipriv.h
+3
-4
registry.c
dlls/msi/registry.c
+35
-62
No files found.
dlls/msi/action.c
View file @
0c01c586
...
...
@@ -3841,13 +3841,13 @@ static UINT ACTION_PublishFeatures(MSIPACKAGE *package)
if
(
!
msi_check_publish
(
package
))
return
ERROR_SUCCESS
;
if
(
package
->
Context
==
MSIINSTALLCONTEXT_MACHINE
)
{
rc
=
MSIREG_OpenLocalClassesFeaturesKey
(
package
->
ProductCode
,
rc
=
MSIREG_OpenFeaturesKey
(
package
->
ProductCode
,
package
->
Context
,
&
hkey
,
TRUE
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
if
(
package
->
Context
==
MSIINSTALLCONTEXT_MACHINE
)
{
rc
=
MSIREG_OpenLocalUserDataFeaturesKey
(
package
->
ProductCode
,
&
userdata
,
TRUE
);
if
(
rc
!=
ERROR_SUCCESS
)
...
...
@@ -3855,10 +3855,6 @@ static UINT ACTION_PublishFeatures(MSIPACKAGE *package)
}
else
{
rc
=
MSIREG_OpenUserFeaturesKey
(
package
->
ProductCode
,
&
hkey
,
TRUE
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
rc
=
MSIREG_OpenUserDataFeaturesKey
(
package
->
ProductCode
,
&
userdata
,
TRUE
);
if
(
rc
!=
ERROR_SUCCESS
)
...
...
@@ -3961,7 +3957,8 @@ static UINT msi_unpublish_feature(MSIPACKAGE *package, MSIFEATURE *feature)
TRACE
(
"unpublishing feature %s
\n
"
,
debugstr_w
(
feature
->
Feature
));
r
=
MSIREG_OpenUserFeaturesKey
(
package
->
ProductCode
,
&
hkey
,
FALSE
);
r
=
MSIREG_OpenFeaturesKey
(
package
->
ProductCode
,
package
->
Context
,
&
hkey
,
FALSE
);
if
(
r
==
ERROR_SUCCESS
)
{
RegDeleteValueW
(
hkey
,
feature
->
Feature
);
...
...
dlls/msi/msi.c
View file @
0c01c586
...
...
@@ -1933,10 +1933,13 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
if
(
!
squash_guid
(
szProduct
,
squishProduct
))
return
INSTALLSTATE_INVALIDARG
;
if
(
MSIREG_OpenManagedFeaturesKey
(
szProduct
,
&
hkey
,
FALSE
)
!=
ERROR_SUCCESS
&&
MSIREG_OpenUserFeaturesKey
(
szProduct
,
&
hkey
,
FALSE
)
!=
ERROR_SUCCESS
)
if
(
MSIREG_OpenFeaturesKey
(
szProduct
,
MSIINSTALLCONTEXT_USERMANAGED
,
&
hkey
,
FALSE
)
!=
ERROR_SUCCESS
&&
MSIREG_OpenFeaturesKey
(
szProduct
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
&
hkey
,
FALSE
)
!=
ERROR_SUCCESS
)
{
rc
=
MSIREG_OpenLocalClassesFeaturesKey
(
szProduct
,
&
hkey
,
FALSE
);
rc
=
MSIREG_OpenFeaturesKey
(
szProduct
,
MSIINSTALLCONTEXT_MACHINE
,
&
hkey
,
FALSE
);
if
(
rc
!=
ERROR_SUCCESS
)
return
INSTALLSTATE_UNKNOWN
;
...
...
dlls/msi/msipriv.h
View file @
0c01c586
...
...
@@ -766,8 +766,10 @@ extern UINT MSIREG_OpenUninstallKey(LPCWSTR szProduct, HKEY* key, BOOL create);
extern
UINT
MSIREG_DeleteUninstallKey
(
LPCWSTR
szProduct
);
extern
UINT
MSIREG_OpenProductKey
(
LPCWSTR
szProduct
,
MSIINSTALLCONTEXT
context
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenFeaturesKey
(
LPCWSTR
szProduct
,
MSIINSTALLCONTEXT
context
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenUserPatchesKey
(
LPCWSTR
szPatch
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenFeaturesKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_Open
Installer
FeaturesKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenUserDataFeaturesKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenUserComponentsKey
(
LPCWSTR
szComponent
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenLocalUserDataComponentKey
(
LPCWSTR
szComponent
,
HKEY
*
key
,
BOOL
create
);
...
...
@@ -778,7 +780,6 @@ extern UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, HKEY* key, BOOL cre
extern
UINT
MSIREG_OpenLocalUserDataProductKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenCurrentUserInstallProps
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenLocalSystemInstallProps
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenUserFeaturesKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenUserComponentsKey
(
LPCWSTR
szComponent
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenUpgradeCodesKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenUserUpgradeCodesKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
);
...
...
@@ -787,8 +788,6 @@ extern UINT MSIREG_DeleteUserProductKey(LPCWSTR szProduct);
extern
UINT
MSIREG_DeleteUserDataProductKey
(
LPCWSTR
szProduct
);
extern
UINT
MSIREG_OpenLocalSystemProductKey
(
LPCWSTR
szProductCode
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenLocalSystemComponentKey
(
LPCWSTR
szComponent
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenLocalClassesFeaturesKey
(
LPCWSTR
szProductCode
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenManagedFeaturesKey
(
LPCWSTR
szProductCode
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenLocalUserDataFeaturesKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_DeleteUserFeaturesKey
(
LPCWSTR
szProduct
);
extern
UINT
MSIREG_DeleteLocalUserDataComponentKey
(
LPCWSTR
szComponent
);
...
...
dlls/msi/registry.c
View file @
0c01c586
...
...
@@ -605,25 +605,48 @@ UINT MSIREG_OpenUserPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create)
return
rc
;
}
UINT
MSIREG_OpenUserFeaturesKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
)
UINT
MSIREG_OpenFeaturesKey
(
LPCWSTR
szProduct
,
MSIINSTALLCONTEXT
context
,
HKEY
*
key
,
BOOL
create
)
{
UINT
rc
;
UINT
r
;
LPWSTR
usersid
;
HKEY
root
=
HKEY_LOCAL_MACHINE
;
WCHAR
squished_pc
[
GUID_SIZE
];
WCHAR
keypath
[
0x200
];
WCHAR
keypath
[
MAX_PATH
];
TRACE
(
"%s
\n
"
,
debugstr_w
(
szProduct
));
if
(
!
squash_guid
(
szProduct
,
squished_pc
))
TRACE
(
"(%s, %d, %d)
\n
"
,
debugstr_w
(
szProduct
),
context
,
create
);
if
(
!
squash_guid
(
szProduct
,
squished_pc
))
return
ERROR_FUNCTION_FAILED
;
TRACE
(
"squished (%s)
\n
"
,
debugstr_w
(
squished_pc
));
sprintfW
(
keypath
,
szUserFeatures_fmt
,
squished_pc
);
if
(
context
==
MSIINSTALLCONTEXT_MACHINE
)
{
sprintfW
(
keypath
,
szInstaller_LocalClassesFeat_fmt
,
squished_pc
);
}
else
if
(
context
==
MSIINSTALLCONTEXT_USERUNMANAGED
)
{
root
=
HKEY_CURRENT_USER
;
sprintfW
(
keypath
,
szUserFeatures_fmt
,
squished_pc
);
}
else
{
r
=
get_user_sid
(
&
usersid
);
if
(
r
!=
ERROR_SUCCESS
||
!
usersid
)
{
ERR
(
"Failed to retrieve user SID: %d
\n
"
,
r
);
return
r
;
}
sprintfW
(
keypath
,
szInstaller_LocalManagedFeat_fmt
,
usersid
,
squished_pc
);
LocalFree
(
usersid
);
}
if
(
create
)
rc
=
RegCreateKeyW
(
HKEY_CURRENT_USER
,
keypath
,
key
);
else
rc
=
RegOpenKeyW
(
HKEY_CURRENT_USER
,
keypath
,
key
);
return
RegCreateKeyW
(
root
,
keypath
,
key
);
return
rc
;
return
RegOpenKeyW
(
root
,
keypath
,
key
)
;
}
UINT
MSIREG_DeleteUserFeaturesKey
(
LPCWSTR
szProduct
)
...
...
@@ -640,7 +663,7 @@ UINT MSIREG_DeleteUserFeaturesKey(LPCWSTR szProduct)
return
RegDeleteTreeW
(
HKEY_CURRENT_USER
,
keypath
);
}
UINT
MSIREG_OpenFeaturesKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
)
UINT
MSIREG_Open
Installer
FeaturesKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
)
{
UINT
rc
;
WCHAR
squished_pc
[
GUID_SIZE
];
...
...
@@ -1108,26 +1131,6 @@ UINT MSIREG_DeleteLocalClassesProductKey(LPCWSTR szProductCode)
return
RegDeleteTreeW
(
HKEY_LOCAL_MACHINE
,
keypath
);
}
UINT
MSIREG_OpenLocalClassesFeaturesKey
(
LPCWSTR
szProductCode
,
HKEY
*
key
,
BOOL
create
)
{
WCHAR
squished_pc
[
GUID_SIZE
];
WCHAR
keypath
[
0x200
];
TRACE
(
"%s
\n
"
,
debugstr_w
(
szProductCode
));
if
(
!
squash_guid
(
szProductCode
,
squished_pc
))
return
ERROR_FUNCTION_FAILED
;
TRACE
(
"squished (%s)
\n
"
,
debugstr_w
(
squished_pc
));
sprintfW
(
keypath
,
szInstaller_LocalClassesFeat_fmt
,
squished_pc
);
if
(
create
)
return
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
return
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
}
UINT
MSIREG_DeleteLocalClassesFeaturesKey
(
LPCWSTR
szProductCode
)
{
WCHAR
squished_pc
[
GUID_SIZE
];
...
...
@@ -1145,36 +1148,6 @@ UINT MSIREG_DeleteLocalClassesFeaturesKey(LPCWSTR szProductCode)
return
RegDeleteTreeW
(
HKEY_LOCAL_MACHINE
,
keypath
);
}
UINT
MSIREG_OpenManagedFeaturesKey
(
LPCWSTR
szProductCode
,
HKEY
*
key
,
BOOL
create
)
{
WCHAR
squished_pc
[
GUID_SIZE
];
WCHAR
keypath
[
0x200
];
LPWSTR
usersid
;
UINT
r
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
szProductCode
));
if
(
!
squash_guid
(
szProductCode
,
squished_pc
))
return
ERROR_FUNCTION_FAILED
;
TRACE
(
"squished (%s)
\n
"
,
debugstr_w
(
squished_pc
));
r
=
get_user_sid
(
&
usersid
);
if
(
r
!=
ERROR_SUCCESS
||
!
usersid
)
{
ERR
(
"Failed to retrieve user SID: %d
\n
"
,
r
);
return
r
;
}
sprintfW
(
keypath
,
szInstaller_LocalManagedFeat_fmt
,
usersid
,
squished_pc
);
LocalFree
(
usersid
);
if
(
create
)
return
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
return
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
}
UINT
MSIREG_OpenClassesUpgradeCodesKey
(
LPCWSTR
szUpgradeCode
,
HKEY
*
key
,
BOOL
create
)
{
WCHAR
squished_pc
[
GUID_SIZE
];
...
...
@@ -1381,7 +1354,7 @@ UINT WINAPI MsiEnumFeaturesW(LPCWSTR szProduct, DWORD index,
if
(
!
szProduct
)
return
ERROR_INVALID_PARAMETER
;
r
=
MSIREG_OpenFeaturesKey
(
szProduct
,
&
hkeyProduct
,
FALSE
);
r
=
MSIREG_Open
Installer
FeaturesKey
(
szProduct
,
&
hkeyProduct
,
FALSE
);
if
(
r
!=
ERROR_SUCCESS
)
return
ERROR_NO_MORE_ITEMS
;
...
...
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