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
39a56382
Commit
39a56382
authored
Jul 02, 2007
by
James Hawkins
Committed by
Alexandre Julliard
Jul 03, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Read the components state directly from the registry.
parent
34f6af95
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
18 deletions
+52
-18
msi.c
dlls/msi/msi.c
+11
-10
msipriv.h
dlls/msi/msipriv.h
+1
-0
registry.c
dlls/msi/registry.c
+38
-0
msi.c
dlls/msi/tests/msi.c
+2
-8
No files found.
dlls/msi/msi.c
View file @
39a56382
...
...
@@ -1229,7 +1229,7 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
{
WCHAR
squishProduct
[
33
],
comp
[
GUID_SIZE
];
GUID
guid
;
LPWSTR
components
,
p
,
parent_feature
;
LPWSTR
components
,
p
,
parent_feature
,
path
;
UINT
rc
;
HKEY
hkey
;
INSTALLSTATE
r
;
...
...
@@ -1284,17 +1284,18 @@ INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
}
StringFromGUID2
(
&
guid
,
comp
,
GUID_SIZE
);
r
=
MsiGetComponentPathW
(
szProduct
,
comp
,
NULL
,
0
);
TRACE
(
"component %s state %d
\n
"
,
debugstr_guid
(
&
guid
),
r
);
switch
(
r
)
rc
=
MSIREG_OpenUserDataComponentKey
(
comp
,
&
hkey
,
FALSE
);
if
(
rc
!=
ERROR_SUCCESS
)
{
case
INSTALLSTATE_NOTUSED
:
case
INSTALLSTATE_LOCAL
:
case
INSTALLSTATE_SOURCE
:
break
;
default:
missing
=
TRUE
;
msi_free
(
components
);
return
INSTALLSTATE_ADVERTISED
;
}
path
=
msi_reg_get_val_str
(
hkey
,
squishProduct
);
if
(
!
path
)
missing
=
TRUE
;
msi_free
(
path
);
}
TRACE
(
"%s %s -> %d
\n
"
,
debugstr_w
(
szProduct
),
debugstr_w
(
szFeature
),
r
);
...
...
dlls/msi/msipriv.h
View file @
39a56382
...
...
@@ -707,6 +707,7 @@ extern UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, HKEY *key, BOOL cr
extern
UINT
MSIREG_OpenComponents
(
HKEY
*
key
);
extern
UINT
MSIREG_OpenUserComponentsKey
(
LPCWSTR
szComponent
,
HKEY
*
key
,
BOOL
create
);
extern
UINT
MSIREG_OpenComponentsKey
(
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
);
extern
UINT
MSIREG_OpenUserDataProductKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
);
...
...
dlls/msi/registry.c
View file @
39a56382
...
...
@@ -103,6 +103,15 @@ static const WCHAR szUser_Components_fmt[] = {
'C'
,
'o'
,
'm'
,
'p'
,
'o'
,
'n'
,
'e'
,
'n'
,
't'
,
's'
,
'\\'
,
'%'
,
's'
,
0
};
static
const
WCHAR
szUserDataComp_fmt
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'\\'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
'e'
,
'r'
,
'\\'
,
'U'
,
's'
,
'e'
,
'r'
,
'D'
,
'a'
,
't'
,
'a'
,
'\\'
,
'%'
,
's'
,
'\\'
,
'C'
,
'o'
,
'm'
,
'p'
,
'o'
,
'n'
,
'e'
,
'n'
,
't'
,
's'
,
'\\'
,
'%'
,
's'
,
0
};
static
const
WCHAR
szUninstall_fmt
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
...
...
@@ -631,6 +640,35 @@ UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create)
return
rc
;
}
UINT
MSIREG_OpenUserDataComponentKey
(
LPCWSTR
szComponent
,
HKEY
*
key
,
BOOL
create
)
{
UINT
rc
;
WCHAR
comp
[
GUID_SIZE
];
WCHAR
keypath
[
0x200
];
LPWSTR
usersid
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
szComponent
));
squash_guid
(
szComponent
,
comp
);
TRACE
(
"squished (%s)
\n
"
,
debugstr_w
(
comp
));
rc
=
get_user_sid
(
&
usersid
);
if
(
rc
!=
ERROR_SUCCESS
||
!
usersid
)
{
ERR
(
"Failed to retrieve user SID: %d
\n
"
,
rc
);
return
rc
;
}
sprintfW
(
keypath
,
szUserDataComp_fmt
,
usersid
,
comp
);
if
(
create
)
rc
=
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
else
rc
=
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
keypath
,
key
);
msi_free
(
usersid
);
return
rc
;
}
UINT
MSIREG_OpenUserDataProductKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
BOOL
create
)
{
UINT
rc
;
...
...
dlls/msi/tests/msi.c
View file @
39a56382
...
...
@@ -626,19 +626,13 @@ static void test_MsiQueryFeatureState(void)
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
state
);
}
ok
(
state
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
state
);
res
=
RegSetValueExA
(
compkey
,
prod_squashed
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"apple"
,
1
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
state
);
}
ok
(
state
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
state
);
RegDeleteValueA
(
compkey
,
prod_squashed
);
RegDeleteValueA
(
compkey
,
""
);
...
...
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