Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
4a9f6995
Commit
4a9f6995
authored
Dec 14, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Dec 15, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add the ability to query a specific context for a product key.
parent
d195ee3c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
24 deletions
+18
-24
action.c
dlls/msi/action.c
+4
-14
msi.c
dlls/msi/msi.c
+2
-1
msipriv.h
dlls/msi/msipriv.h
+2
-2
registry.c
dlls/msi/registry.c
+10
-7
No files found.
dlls/msi/action.c
View file @
4a9f6995
...
...
@@ -3589,20 +3589,10 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
if
(
package
->
Context
==
MSIINSTALLCONTEXT_MACHINE
)
{
rc
=
MSIREG_OpenUserDataProductKey
(
package
->
ProductCode
,
szLocalSid
,
&
hudkey
,
TRUE
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
}
else
{
rc
=
MSIREG_OpenUserDataProductKey
(
package
->
ProductCode
,
NULL
,
&
hudkey
,
TRUE
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
}
rc
=
MSIREG_OpenUserDataProductKey
(
package
->
ProductCode
,
package
->
Context
,
NULL
,
&
hudkey
,
TRUE
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
rc
=
msi_publish_upgrade_code
(
package
);
if
(
rc
!=
ERROR_SUCCESS
)
...
...
dlls/msi/msi.c
View file @
4a9f6995
...
...
@@ -1988,7 +1988,8 @@ static INSTALLSTATE MSI_GetComponentPath(LPCWSTR szProduct, LPCWSTR szComponent,
state
=
INSTALLSTATE_ABSENT
;
if
((
MSIREG_OpenInstallProps
(
szProduct
,
szLocalSid
,
&
hkey
,
FALSE
)
==
ERROR_SUCCESS
||
MSIREG_OpenUserDataProductKey
(
szProduct
,
NULL
,
&
hkey
,
FALSE
)
==
ERROR_SUCCESS
)
&&
MSIREG_OpenUserDataProductKey
(
szProduct
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
NULL
,
&
hkey
,
FALSE
)
==
ERROR_SUCCESS
)
&&
msi_reg_get_val_dword
(
hkey
,
wininstaller
,
&
version
)
&&
GetFileAttributesW
(
path
)
!=
INVALID_FILE_ATTRIBUTES
)
{
...
...
dlls/msi/msipriv.h
View file @
4a9f6995
...
...
@@ -776,8 +776,8 @@ extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL cr
extern
UINT
MSIREG_OpenUserDataComponentKey
(
LPCWSTR
szComponent
,
LPCWSTR
szUserSid
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenPatchesKey
(
LPCWSTR
szPatch
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenUserDataProductKey
(
LPCWSTR
szProduct
,
LPCWSTR
szUserSid
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenUserDataProductKey
(
LPCWSTR
szProduct
,
MSIINSTALLCONTEXT
dwContext
,
LPCWSTR
szUserSid
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenCurrentUserInstallProps
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenInstallProps
(
LPCWSTR
szProduct
,
LPCWSTR
szUserSID
,
HKEY
*
key
,
BOOL
create
);
...
...
dlls/msi/registry.c
View file @
4a9f6995
...
...
@@ -799,8 +799,8 @@ UINT MSIREG_DeleteUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid)
return
RegDeleteTreeW
(
HKEY_LOCAL_MACHINE
,
keypath
);
}
UINT
MSIREG_OpenUserDataProductKey
(
LPCWSTR
szProduct
,
LPCWSTR
szUserSid
,
HKEY
*
key
,
BOOL
create
)
UINT
MSIREG_OpenUserDataProductKey
(
LPCWSTR
szProduct
,
MSIINSTALLCONTEXT
dwContext
,
LPCWSTR
szUserSid
,
HKEY
*
key
,
BOOL
create
)
{
UINT
rc
;
WCHAR
squished_pc
[
GUID_SIZE
];
...
...
@@ -812,7 +812,11 @@ UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, LPCWSTR szUserSid,
return
ERROR_FUNCTION_FAILED
;
TRACE
(
"squished (%s)
\n
"
,
debugstr_w
(
squished_pc
));
if
(
!
szUserSid
)
if
(
dwContext
==
MSIINSTALLCONTEXT_MACHINE
)
sprintfW
(
keypath
,
szUserDataProd_fmt
,
szLocalSid
,
squished_pc
);
else
if
(
szUserSid
)
sprintfW
(
keypath
,
szUserDataProd_fmt
,
usersid
,
squished_pc
);
else
{
rc
=
get_user_sid
(
&
usersid
);
if
(
rc
!=
ERROR_SUCCESS
||
!
usersid
)
...
...
@@ -824,8 +828,6 @@ UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, LPCWSTR szUserSid,
sprintfW
(
keypath
,
szUserDataProd_fmt
,
usersid
,
squished_pc
);
LocalFree
(
usersid
);
}
else
sprintfW
(
keypath
,
szUserDataProd_fmt
,
szUserSid
,
squished_pc
);
if
(
create
)
rc
=
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
...
...
@@ -1679,7 +1681,8 @@ static UINT msi_get_patch_state(LPCWSTR prodcode, LPCWSTR usersid,
*
state
=
MSIPATCHSTATE_INVALID
;
/* FIXME: usersid might not be current user */
r
=
MSIREG_OpenUserDataProductKey
(
prodcode
,
NULL
,
&
prod
,
FALSE
);
r
=
MSIREG_OpenUserDataProductKey
(
prodcode
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
NULL
,
&
prod
,
FALSE
);
if
(
r
!=
ERROR_SUCCESS
)
return
ERROR_NO_MORE_ITEMS
;
...
...
@@ -1826,7 +1829,7 @@ static UINT msi_check_product_patches(LPCWSTR prodcode, LPCWSTR usersid,
{
usersid
=
szEmpty
;
if
(
MSIREG_OpenUserDataProductKey
(
prodcode
,
szLocalSid
,
&
localprod
,
FALSE
)
==
ERROR_SUCCESS
&&
if
(
MSIREG_OpenUserDataProductKey
(
prodcode
,
context
,
NULL
,
&
localprod
,
FALSE
)
==
ERROR_SUCCESS
&&
RegOpenKeyExW
(
localprod
,
szPatches
,
0
,
KEY_READ
,
&
localpatch
)
==
ERROR_SUCCESS
&&
RegOpenKeyExW
(
localpatch
,
ptr
,
0
,
KEY_READ
,
&
patchkey
)
==
ERROR_SUCCESS
)
{
...
...
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