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
288af81a
Commit
288af81a
authored
Jun 18, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Jun 18, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Fix the ProcessComponents action to handle the package context.
parent
5f11262d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
4 deletions
+72
-4
action.c
dlls/msi/action.c
+11
-2
msipriv.h
dlls/msi/msipriv.h
+2
-0
registry.c
dlls/msi/registry.c
+34
-2
install.c
dlls/msi/tests/install.c
+25
-0
No files found.
dlls/msi/action.c
View file @
288af81a
...
...
@@ -2886,7 +2886,11 @@ static UINT ACTION_ProcessComponents(MSIPACKAGE *package)
if
(
!
comp
->
FullKeypath
)
continue
;
rc
=
MSIREG_OpenUserDataComponentKey
(
comp
->
ComponentId
,
&
hkey
,
TRUE
);
if
(
package
->
Context
==
MSIINSTALLCONTEXT_MACHINE
)
rc
=
MSIREG_OpenLocalUserDataComponentKey
(
comp
->
ComponentId
,
&
hkey
,
TRUE
);
else
rc
=
MSIREG_OpenUserDataComponentKey
(
comp
->
ComponentId
,
&
hkey
,
TRUE
);
if
(
rc
!=
ERROR_SUCCESS
)
continue
;
...
...
@@ -2904,7 +2908,12 @@ static UINT ACTION_ProcessComponents(MSIPACKAGE *package)
RegCloseKey
(
hkey
);
}
else
if
(
ACTION_VerifyComponentForAction
(
comp
,
INSTALLSTATE_ABSENT
))
MSIREG_DeleteUserDataComponentKey
(
comp
->
ComponentId
);
{
if
(
package
->
Context
==
MSIINSTALLCONTEXT_MACHINE
)
MSIREG_DeleteLocalUserDataComponentKey
(
comp
->
ComponentId
);
else
MSIREG_DeleteUserDataComponentKey
(
comp
->
ComponentId
);
}
/* UI stuff */
uirow
=
MSI_CreateRecord
(
3
);
...
...
dlls/msi/msipriv.h
View file @
288af81a
...
...
@@ -768,6 +768,7 @@ extern UINT MSIREG_OpenUserPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create);
extern
UINT
MSIREG_OpenFeaturesKey
(
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
);
extern
UINT
MSIREG_OpenUserDataComponentKey
(
LPCWSTR
szComponent
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenProductsKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenPatchesKey
(
LPCWSTR
szPatch
,
HKEY
*
key
,
BOOL
create
);
...
...
@@ -786,6 +787,7 @@ extern UINT MSIREG_OpenLocalSystemComponentKey(LPCWSTR szComponent, HKEY *key, B
extern
UINT
MSIREG_OpenLocalClassesProductKey
(
LPCWSTR
szProductCode
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenLocalManagedProductKey
(
LPCWSTR
szProductCode
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_DeleteUserFeaturesKey
(
LPCWSTR
szProduct
);
extern
UINT
MSIREG_DeleteLocalUserDataComponentKey
(
LPCWSTR
szComponent
);
extern
UINT
MSIREG_DeleteUserDataComponentKey
(
LPCWSTR
szComponent
);
extern
LPWSTR
msi_reg_get_val_str
(
HKEY
hkey
,
LPCWSTR
name
);
...
...
dlls/msi/registry.c
View file @
288af81a
...
...
@@ -214,6 +214,8 @@ static const WCHAR szInstaller_LocalManagedProd_fmt[] = {
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
'e'
,
'r'
,
'\\'
,
'P'
,
'r'
,
'o'
,
'd'
,
'u'
,
'c'
,
't'
,
's'
,
'\\'
,
'%'
,
's'
,
0
};
static
const
WCHAR
localsid
[]
=
{
'S'
,
'-'
,
'1'
,
'-'
,
'5'
,
'-'
,
'1'
,
'8'
,
0
};
BOOL
unsquash_guid
(
LPCWSTR
in
,
LPWSTR
out
)
{
DWORD
i
,
n
=
0
;
...
...
@@ -666,6 +668,38 @@ UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create)
return
rc
;
}
UINT
MSIREG_OpenLocalUserDataComponentKey
(
LPCWSTR
szComponent
,
HKEY
*
key
,
BOOL
create
)
{
WCHAR
comp
[
GUID_SIZE
];
WCHAR
keypath
[
0x200
];
TRACE
(
"%s
\n
"
,
debugstr_w
(
szComponent
));
if
(
!
squash_guid
(
szComponent
,
comp
))
return
ERROR_FUNCTION_FAILED
;
TRACE
(
"squished (%s)
\n
"
,
debugstr_w
(
comp
));
sprintfW
(
keypath
,
szUserDataComp_fmt
,
localsid
,
comp
);
if
(
create
)
return
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
return
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
}
UINT
MSIREG_DeleteLocalUserDataComponentKey
(
LPCWSTR
szComponent
)
{
WCHAR
comp
[
GUID_SIZE
];
WCHAR
keypath
[
0x200
];
TRACE
(
"%s
\n
"
,
debugstr_w
(
szComponent
));
if
(
!
squash_guid
(
szComponent
,
comp
))
return
ERROR_FUNCTION_FAILED
;
TRACE
(
"squished (%s)
\n
"
,
debugstr_w
(
comp
));
sprintfW
(
keypath
,
szUserDataComp_fmt
,
localsid
,
comp
);
return
RegDeleteTreeW
(
HKEY_LOCAL_MACHINE
,
keypath
);
}
UINT
MSIREG_OpenUserDataComponentKey
(
LPCWSTR
szComponent
,
HKEY
*
key
,
BOOL
create
)
{
UINT
rc
;
...
...
@@ -795,8 +829,6 @@ UINT MSIREG_OpenCurrentUserInstallProps(LPCWSTR szProduct, HKEY *key,
UINT
MSIREG_OpenLocalSystemInstallProps
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
)
{
static
const
WCHAR
localsid
[]
=
{
'S'
,
'-'
,
'1'
,
'-'
,
'5'
,
'-'
,
'1'
,
'8'
,
0
};
return
MSIREG_OpenInstallProps
(
szProduct
,
localsid
,
key
,
create
);
}
...
...
dlls/msi/tests/install.c
View file @
288af81a
...
...
@@ -2773,6 +2773,31 @@ static void test_publish_processcomponents(void)
RegDeleteKeyA
(
comp
,
""
);
RegCloseKey
(
comp
);
/* ProcessComponents, machine */
r
=
MsiInstallProductA
(
msifile
,
"PROCESS_COMPONENTS=1 ALLUSERS=1"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
delete_pf
(
"msitest
\\
maximus"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest"
,
FALSE
),
"File not installed
\n
"
);
sprintf
(
keypath
,
keyfmt
,
"S-1-5-18"
);
res
=
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
keypath
,
&
comp
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
size
=
MAX_PATH
;
res
=
RegQueryValueExA
(
comp
,
"84A88FD7F6998CE40A22FB59F6B9C2BB"
,
NULL
,
NULL
,
(
LPBYTE
)
val
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
!
lstrcmpA
(
val
,
"C:
\\
Program Files
\\
msitest
\\
maximus"
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
"C:
\\
Program Files
\\
msitest
\\
maximus"
,
val
);
res
=
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
compkey
,
&
hkey
);
ok
(
res
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
res
);
RegDeleteValueA
(
comp
,
"84A88FD7F6998CE40A22FB59F6B9C2BB"
);
RegDeleteKeyA
(
comp
,
""
);
RegCloseKey
(
comp
);
DeleteFile
(
msifile
);
DeleteFile
(
"msitest
\\
maximus"
);
RemoveDirectory
(
"msitest"
);
...
...
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