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
930b429d
Commit
930b429d
authored
Dec 09, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Dec 09, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add the ability to open multiple users product keys.
parent
947c4c31
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
34 deletions
+24
-34
action.c
dlls/msi/action.c
+4
-2
helpers.c
dlls/msi/helpers.c
+1
-0
msi.c
dlls/msi/msi.c
+1
-1
msipriv.h
dlls/msi/msipriv.h
+3
-2
registry.c
dlls/msi/registry.c
+15
-29
No files found.
dlls/msi/action.c
View file @
930b429d
...
...
@@ -3589,13 +3589,15 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
if
(
package
->
Context
==
MSIINSTALLCONTEXT_MACHINE
)
{
rc
=
MSIREG_OpenLocalUserDataProductKey
(
package
->
ProductCode
,
&
hudkey
,
TRUE
);
rc
=
MSIREG_OpenUserDataProductKey
(
package
->
ProductCode
,
szLocalSid
,
&
hudkey
,
TRUE
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
}
else
{
rc
=
MSIREG_OpenUserDataProductKey
(
package
->
ProductCode
,
&
hudkey
,
TRUE
);
rc
=
MSIREG_OpenUserDataProductKey
(
package
->
ProductCode
,
NULL
,
&
hudkey
,
TRUE
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
}
...
...
dlls/msi/helpers.c
View file @
930b429d
...
...
@@ -41,6 +41,7 @@ const WCHAR cszSourceDir[] = {'S','o','u','r','c','e','D','i','r',0};
const
WCHAR
cszSOURCEDIR
[]
=
{
'S'
,
'O'
,
'U'
,
'R'
,
'C'
,
'E'
,
'D'
,
'I'
,
'R'
,
0
};
const
WCHAR
cszRootDrive
[]
=
{
'R'
,
'O'
,
'O'
,
'T'
,
'D'
,
'R'
,
'I'
,
'V'
,
'E'
,
0
};
const
WCHAR
cszbs
[]
=
{
'\\'
,
0
};
const
WCHAR
szLocalSid
[]
=
{
'S'
,
'-'
,
'1'
,
'-'
,
'5'
,
'-'
,
'1'
,
'8'
,
0
};
LPWSTR
build_icon_path
(
MSIPACKAGE
*
package
,
LPCWSTR
icon_name
)
{
...
...
dlls/msi/msi.c
View file @
930b429d
...
...
@@ -1785,7 +1785,7 @@ static INSTALLSTATE MSI_GetComponentPath(LPCWSTR szProduct, LPCWSTR szComponent,
state
=
INSTALLSTATE_ABSENT
;
if
((
MSIREG_OpenLocalSystemProductKey
(
szProduct
,
&
hkey
,
FALSE
)
==
ERROR_SUCCESS
||
MSIREG_OpenUserDataProductKey
(
szProduct
,
&
hkey
,
FALSE
)
==
ERROR_SUCCESS
)
&&
MSIREG_OpenUserDataProductKey
(
szProduct
,
NULL
,
&
hkey
,
FALSE
)
==
ERROR_SUCCESS
)
&&
msi_reg_get_val_dword
(
hkey
,
wininstaller
,
&
version
)
&&
GetFileAttributesW
(
path
)
!=
INVALID_FILE_ATTRIBUTES
)
{
...
...
dlls/msi/msipriv.h
View file @
930b429d
...
...
@@ -776,8 +776,8 @@ extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL cr
extern
UINT
MSIREG_OpenLocalUserDataComponentKey
(
LPCWSTR
szComponent
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenUserDataComponentKey
(
LPCWSTR
szComponent
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenPatchesKey
(
LPCWSTR
szPatch
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenUserDataProductKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenLocalUserDataProductKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenUserDataProductKey
(
LPCWSTR
szProduct
,
LPCWSTR
szUserSid
,
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_OpenUpgradeCodesKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
);
...
...
@@ -1042,6 +1042,7 @@ extern const WCHAR cszSourceDir[];
extern
const
WCHAR
cszSOURCEDIR
[];
extern
const
WCHAR
cszRootDrive
[];
extern
const
WCHAR
cszbs
[];
extern
const
WCHAR
szLocalSid
[];
/* memory allocation macro functions */
static
void
*
msi_alloc
(
size_t
len
)
__WINE_ALLOC_SIZE
(
1
);
...
...
dlls/msi/registry.c
View file @
930b429d
...
...
@@ -244,8 +244,6 @@ static const WCHAR szInstaller_ClassesUpgrade_fmt[] = {
'U'
,
'p'
,
'g'
,
'r'
,
'a'
,
'd'
,
'e'
,
'C'
,
'o'
,
'd'
,
'e'
,
's'
,
'\\'
,
'%'
,
's'
,
0
};
static
const
WCHAR
localsid
[]
=
{
'S'
,
'-'
,
'1'
,
'-'
,
'5'
,
'-'
,
'1'
,
'8'
,
0
};
BOOL
unsquash_guid
(
LPCWSTR
in
,
LPWSTR
out
)
{
DWORD
i
,
n
=
0
;
...
...
@@ -713,7 +711,7 @@ UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context
if
(
context
==
MSIINSTALLCONTEXT_MACHINE
)
{
sprintfW
(
keypath
,
szUserDataFeatures_fmt
,
locals
id
,
squished_pc
);
sprintfW
(
keypath
,
szUserDataFeatures_fmt
,
szLocalS
id
,
squished_pc
);
}
else
{
...
...
@@ -765,7 +763,7 @@ UINT MSIREG_OpenLocalUserDataComponentKey(LPCWSTR szComponent, HKEY *key, BOOL c
return
ERROR_FUNCTION_FAILED
;
TRACE
(
"squished (%s)
\n
"
,
debugstr_w
(
comp
));
sprintfW
(
keypath
,
szUserDataComp_fmt
,
locals
id
,
comp
);
sprintfW
(
keypath
,
szUserDataComp_fmt
,
szLocalS
id
,
comp
);
if
(
create
)
return
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
...
...
@@ -783,7 +781,7 @@ UINT MSIREG_DeleteLocalUserDataComponentKey(LPCWSTR szComponent)
return
ERROR_FUNCTION_FAILED
;
TRACE
(
"squished (%s)
\n
"
,
debugstr_w
(
comp
));
sprintfW
(
keypath
,
szUserDataComp_fmt
,
locals
id
,
comp
);
sprintfW
(
keypath
,
szUserDataComp_fmt
,
szLocalS
id
,
comp
);
return
RegDeleteTreeW
(
HKEY_LOCAL_MACHINE
,
keypath
);
}
...
...
@@ -842,7 +840,8 @@ UINT MSIREG_DeleteUserDataComponentKey(LPCWSTR szComponent)
return
RegDeleteTreeW
(
HKEY_LOCAL_MACHINE
,
keypath
);
}
UINT
MSIREG_OpenUserDataProductKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
)
UINT
MSIREG_OpenUserDataProductKey
(
LPCWSTR
szProduct
,
LPCWSTR
szUserSid
,
HKEY
*
key
,
BOOL
create
)
{
UINT
rc
;
WCHAR
squished_pc
[
GUID_SIZE
];
...
...
@@ -854,6 +853,8 @@ UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, HKEY *key, BOOL create)
return
ERROR_FUNCTION_FAILED
;
TRACE
(
"squished (%s)
\n
"
,
debugstr_w
(
squished_pc
));
if
(
!
szUserSid
)
{
rc
=
get_user_sid
(
&
usersid
);
if
(
rc
!=
ERROR_SUCCESS
||
!
usersid
)
{
...
...
@@ -862,13 +863,16 @@ UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, HKEY *key, BOOL create)
}
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
);
else
rc
=
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
LocalFree
(
usersid
);
return
rc
;
}
...
...
@@ -898,24 +902,6 @@ UINT MSIREG_OpenUserDataPatchKey(LPWSTR patch, HKEY *key, BOOL create)
return
rc
;
}
UINT
MSIREG_OpenLocalUserDataProductKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
)
{
WCHAR
squished_pc
[
GUID_SIZE
];
WCHAR
keypath
[
0x200
];
TRACE
(
"%s
\n
"
,
debugstr_w
(
szProduct
));
if
(
!
squash_guid
(
szProduct
,
squished_pc
))
return
ERROR_FUNCTION_FAILED
;
TRACE
(
"squished (%s)
\n
"
,
debugstr_w
(
squished_pc
));
sprintfW
(
keypath
,
szUserDataProd_fmt
,
localsid
,
squished_pc
);
if
(
create
)
return
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
return
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
}
static
UINT
MSIREG_OpenInstallProps
(
LPCWSTR
szProduct
,
LPCWSTR
szUserSID
,
HKEY
*
key
,
BOOL
create
)
{
...
...
@@ -960,7 +946,7 @@ UINT MSIREG_OpenCurrentUserInstallProps(LPCWSTR szProduct, HKEY *key,
UINT
MSIREG_OpenLocalSystemInstallProps
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
)
{
return
MSIREG_OpenInstallProps
(
szProduct
,
locals
id
,
key
,
create
);
return
MSIREG_OpenInstallProps
(
szProduct
,
szLocalS
id
,
key
,
create
);
}
UINT
MSIREG_DeleteUserDataProductKey
(
LPCWSTR
szProduct
)
...
...
@@ -1780,7 +1766,7 @@ static UINT msi_get_patch_state(LPCWSTR prodcode, LPCWSTR usersid,
*
state
=
MSIPATCHSTATE_INVALID
;
/* FIXME: usersid might not be current user */
r
=
MSIREG_OpenUserDataProductKey
(
prodcode
,
&
prod
,
FALSE
);
r
=
MSIREG_OpenUserDataProductKey
(
prodcode
,
NULL
,
&
prod
,
FALSE
);
if
(
r
!=
ERROR_SUCCESS
)
return
ERROR_NO_MORE_ITEMS
;
...
...
@@ -1912,7 +1898,7 @@ static UINT msi_check_product_patches(LPCWSTR prodcode, LPCWSTR usersid,
{
usersid
=
szEmpty
;
if
(
MSIREG_Open
LocalUserDataProductKey
(
prodcode
,
&
localprod
,
FALSE
)
==
ERROR_SUCCESS
&&
if
(
MSIREG_Open
UserDataProductKey
(
prodcode
,
szLocalSid
,
&
localprod
,
FALSE
)
==
ERROR_SUCCESS
&&
RegOpenKeyExW
(
localprod
,
szPatches
,
0
,
KEY_READ
,
&
localpatch
)
==
ERROR_SUCCESS
&&
RegOpenKeyExW
(
localpatch
,
ptr
,
0
,
KEY_READ
,
&
patchkey
)
==
ERROR_SUCCESS
)
{
...
...
@@ -1988,7 +1974,7 @@ UINT WINAPI MsiEnumPatchesExW(LPCWSTR szProductCode, LPCWSTR szUserSid,
if
(
!
szProductCode
||
!
squash_guid
(
szProductCode
,
squished_pc
))
return
ERROR_INVALID_PARAMETER
;
if
(
!
lstrcmpW
(
szUserSid
,
locals
id
))
if
(
!
lstrcmpW
(
szUserSid
,
szLocalS
id
))
return
ERROR_INVALID_PARAMETER
;
if
(
dwContext
&
MSIINSTALLCONTEXT_MACHINE
&&
szUserSid
)
...
...
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