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
14d439c8
Commit
14d439c8
authored
Nov 05, 2007
by
James Hawkins
Committed by
Alexandre Julliard
Nov 05, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Handle the MSIINSTALLCONTEXT_USERMANAGED context.
parent
3d5b3ef9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
64 deletions
+35
-64
source.c
dlls/msi/source.c
+16
-27
install.c
dlls/msi/tests/install.c
+6
-3
source.c
dlls/msi/tests/source.c
+13
-34
No files found.
dlls/msi/source.c
View file @
14d439c8
...
@@ -52,20 +52,28 @@ typedef struct tagMediaInfo
...
@@ -52,20 +52,28 @@ typedef struct tagMediaInfo
DWORD
index
;
DWORD
index
;
}
media_info
;
}
media_info
;
static
UINT
OpenSourceKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
DWORD
dwOptions
,
BOOL
user
,
BOOL
create
)
static
UINT
OpenSourceKey
(
LPCWSTR
szProduct
,
HKEY
*
key
,
DWORD
dwOptions
,
MSIINSTALLCONTEXT
context
,
BOOL
create
)
{
{
HKEY
rootkey
=
0
;
HKEY
rootkey
=
0
;
UINT
rc
;
UINT
rc
=
ERROR_FUNCTION_FAILED
;
static
const
WCHAR
szSourceList
[]
=
{
'S'
,
'o'
,
'u'
,
'r'
,
'c'
,
'e'
,
'L'
,
'i'
,
's'
,
't'
,
0
};
static
const
WCHAR
szSourceList
[]
=
{
'S'
,
'o'
,
'u'
,
'r'
,
'c'
,
'e'
,
'L'
,
'i'
,
's'
,
't'
,
0
};
if
(
user
)
if
(
context
==
MSIINSTALLCONTEXT_USERUNMANAGED
)
{
{
if
(
dwOptions
==
MSICODE_PATCH
)
if
(
dwOptions
==
MSICODE_PATCH
)
rc
=
MSIREG_OpenUserPatchesKey
(
szProduct
,
&
rootkey
,
create
);
rc
=
MSIREG_OpenUserPatchesKey
(
szProduct
,
&
rootkey
,
create
);
else
else
rc
=
MSIREG_OpenUserProductsKey
(
szProduct
,
&
rootkey
,
create
);
rc
=
MSIREG_OpenUserProductsKey
(
szProduct
,
&
rootkey
,
create
);
}
}
else
else
if
(
context
==
MSIINSTALLCONTEXT_USERMANAGED
)
{
if
(
dwOptions
==
MSICODE_PATCH
)
rc
=
MSIREG_OpenUserPatchesKey
(
szProduct
,
&
rootkey
,
create
);
else
rc
=
MSIREG_OpenLocalManagedProductKey
(
szProduct
,
&
rootkey
,
create
);
}
else
if
(
context
==
MSIINSTALLCONTEXT_MACHINE
)
{
{
if
(
dwOptions
==
MSICODE_PATCH
)
if
(
dwOptions
==
MSICODE_PATCH
)
rc
=
MSIREG_OpenPatchesKey
(
szProduct
,
&
rootkey
,
create
);
rc
=
MSIREG_OpenPatchesKey
(
szProduct
,
&
rootkey
,
create
);
...
@@ -235,11 +243,7 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
...
@@ -235,11 +243,7 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
if
(
dwContext
==
MSIINSTALLCONTEXT_USERUNMANAGED
)
if
(
dwContext
==
MSIINSTALLCONTEXT_USERUNMANAGED
)
FIXME
(
"Unknown context MSIINSTALLCONTEXT_USERUNMANAGED
\n
"
);
FIXME
(
"Unknown context MSIINSTALLCONTEXT_USERUNMANAGED
\n
"
);
if
(
dwContext
==
MSIINSTALLCONTEXT_MACHINE
)
rc
=
OpenSourceKey
(
szProduct
,
&
sourcekey
,
dwOptions
,
dwContext
,
FALSE
);
rc
=
OpenSourceKey
(
szProduct
,
&
sourcekey
,
dwOptions
,
FALSE
,
FALSE
);
else
rc
=
OpenSourceKey
(
szProduct
,
&
sourcekey
,
dwOptions
,
TRUE
,
FALSE
);
if
(
rc
!=
ERROR_SUCCESS
)
if
(
rc
!=
ERROR_SUCCESS
)
return
rc
;
return
rc
;
...
@@ -382,11 +386,7 @@ UINT WINAPI MsiSourceListSetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
...
@@ -382,11 +386,7 @@ UINT WINAPI MsiSourceListSetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
if
(
dwContext
==
MSIINSTALLCONTEXT_USERUNMANAGED
)
if
(
dwContext
==
MSIINSTALLCONTEXT_USERUNMANAGED
)
FIXME
(
"Unknown context MSIINSTALLCONTEXT_USERUNMANAGED
\n
"
);
FIXME
(
"Unknown context MSIINSTALLCONTEXT_USERUNMANAGED
\n
"
);
if
(
dwContext
==
MSIINSTALLCONTEXT_MACHINE
)
rc
=
OpenSourceKey
(
szProduct
,
&
sourcekey
,
MSICODE_PRODUCT
,
dwContext
,
TRUE
);
rc
=
OpenSourceKey
(
szProduct
,
&
sourcekey
,
MSICODE_PRODUCT
,
FALSE
,
TRUE
);
else
rc
=
OpenSourceKey
(
szProduct
,
&
sourcekey
,
MSICODE_PRODUCT
,
TRUE
,
TRUE
);
if
(
rc
!=
ERROR_SUCCESS
)
if
(
rc
!=
ERROR_SUCCESS
)
return
ERROR_UNKNOWN_PRODUCT
;
return
ERROR_UNKNOWN_PRODUCT
;
...
@@ -670,14 +670,7 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid,
...
@@ -670,14 +670,7 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid,
if
(
szUserSid
)
if
(
szUserSid
)
FIXME
(
"Unhandled UserSid %s
\n
"
,
debugstr_w
(
szUserSid
));
FIXME
(
"Unhandled UserSid %s
\n
"
,
debugstr_w
(
szUserSid
));
if
(
dwContext
==
MSIINSTALLCONTEXT_USERUNMANAGED
)
rc
=
OpenSourceKey
(
szProduct
,
&
sourcekey
,
MSICODE_PRODUCT
,
dwContext
,
FALSE
);
FIXME
(
"Unknown context MSIINSTALLCONTEXT_USERUNMANAGED
\n
"
);
if
(
dwContext
==
MSIINSTALLCONTEXT_MACHINE
)
rc
=
OpenSourceKey
(
szProduct
,
&
sourcekey
,
MSICODE_PRODUCT
,
FALSE
,
FALSE
);
else
rc
=
OpenSourceKey
(
szProduct
,
&
sourcekey
,
MSICODE_PRODUCT
,
TRUE
,
FALSE
);
if
(
rc
!=
ERROR_SUCCESS
)
if
(
rc
!=
ERROR_SUCCESS
)
return
rc
;
return
rc
;
...
@@ -797,11 +790,7 @@ UINT WINAPI MsiSourceListAddMediaDiskW(LPCWSTR szProduct, LPCWSTR szUserSid,
...
@@ -797,11 +790,7 @@ UINT WINAPI MsiSourceListAddMediaDiskW(LPCWSTR szProduct, LPCWSTR szUserSid,
if
(
dwContext
==
MSIINSTALLCONTEXT_USERUNMANAGED
)
if
(
dwContext
==
MSIINSTALLCONTEXT_USERUNMANAGED
)
FIXME
(
"Unknown context MSIINSTALLCONTEXT_USERUNMANAGED
\n
"
);
FIXME
(
"Unknown context MSIINSTALLCONTEXT_USERUNMANAGED
\n
"
);
if
(
dwContext
==
MSIINSTALLCONTEXT_MACHINE
)
rc
=
OpenSourceKey
(
szProduct
,
&
sourcekey
,
MSICODE_PRODUCT
,
dwContext
,
TRUE
);
rc
=
OpenSourceKey
(
szProduct
,
&
sourcekey
,
MSICODE_PRODUCT
,
FALSE
,
TRUE
);
else
rc
=
OpenSourceKey
(
szProduct
,
&
sourcekey
,
MSICODE_PRODUCT
,
TRUE
,
TRUE
);
if
(
rc
!=
ERROR_SUCCESS
)
if
(
rc
!=
ERROR_SUCCESS
)
return
ERROR_UNKNOWN_PRODUCT
;
return
ERROR_UNKNOWN_PRODUCT
;
...
...
dlls/msi/tests/install.c
View file @
14d439c8
...
@@ -2345,9 +2345,12 @@ static void test_publishsourcelist(void)
...
@@ -2345,9 +2345,12 @@ static void test_publishsourcelist(void)
lstrcpyA
(
value
,
"aaa"
);
lstrcpyA
(
value
,
"aaa"
);
r
=
pMsiSourceListGetInfoA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
r
=
pMsiSourceListGetInfoA
(
prodcode
,
NULL
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
MSICODE_PRODUCT
,
INSTALLPROPERTY_PACKAGENAME
,
value
,
&
size
);
MSICODE_PRODUCT
,
INSTALLPROPERTY_PACKAGENAME
,
value
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmpA
(
value
,
"msitest.msi"
),
"Expected 'msitest.msi', got %s
\n
"
,
value
);
{
ok
(
size
==
11
,
"Expected 11, got %d
\n
"
,
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
value
,
"msitest.msi"
),
"Expected 'msitest.msi', got %s
\n
"
,
value
);
ok
(
size
==
11
,
"Expected 11, got %d
\n
"
,
size
);
}
/* complete uninstall */
/* complete uninstall */
r
=
MsiInstallProductA
(
msifile
,
"FULL=1 REMOVE=ALL"
);
r
=
MsiInstallProductA
(
msifile
,
"FULL=1 REMOVE=ALL"
);
...
...
dlls/msi/tests/source.c
View file @
14d439c8
...
@@ -591,10 +591,7 @@ static void test_MsiSourceListAddSourceEx(void)
...
@@ -591,10 +591,7 @@ static void test_MsiSourceListAddSourceEx(void)
r
=
pMsiSourceListAddSourceExA
(
prodcode
,
usersid
,
r
=
pMsiSourceListAddSourceExA
(
prodcode
,
usersid
,
MSIINSTALLCONTEXT_USERMANAGED
,
MSIINSTALLCONTEXT_USERMANAGED
,
MSICODE_PRODUCT
|
MSISOURCETYPE_URL
,
"C:
\\
source"
,
0
);
MSICODE_PRODUCT
|
MSISOURCETYPE_URL
,
"C:
\\
source"
,
0
);
todo_wine
ok
(
r
==
ERROR_UNKNOWN_PRODUCT
,
"Expected ERROR_UNKNOWN_PRODUCT, got %d
\n
"
,
r
);
{
ok
(
r
==
ERROR_UNKNOWN_PRODUCT
,
"Expected ERROR_UNKNOWN_PRODUCT, got %d
\n
"
,
r
);
}
lstrcpyA
(
keypath
,
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Installer
\\
Managed
\\
"
);
lstrcpyA
(
keypath
,
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Installer
\\
Managed
\\
"
);
lstrcatA
(
keypath
,
usersid
);
lstrcatA
(
keypath
,
usersid
);
...
@@ -608,10 +605,7 @@ static void test_MsiSourceListAddSourceEx(void)
...
@@ -608,10 +605,7 @@ static void test_MsiSourceListAddSourceEx(void)
r
=
pMsiSourceListAddSourceExA
(
prodcode
,
usersid
,
r
=
pMsiSourceListAddSourceExA
(
prodcode
,
usersid
,
MSIINSTALLCONTEXT_USERMANAGED
,
MSIINSTALLCONTEXT_USERMANAGED
,
MSICODE_PRODUCT
|
MSISOURCETYPE_URL
,
"C:
\\
source"
,
0
);
MSICODE_PRODUCT
|
MSISOURCETYPE_URL
,
"C:
\\
source"
,
0
);
todo_wine
ok
(
r
==
ERROR_BAD_CONFIGURATION
,
"Expected ERROR_BAD_CONFIGURATION, got %d
\n
"
,
r
);
{
ok
(
r
==
ERROR_BAD_CONFIGURATION
,
"Expected ERROR_BAD_CONFIGURATION, got %d
\n
"
,
r
);
}
res
=
RegCreateKeyA
(
prodkey
,
"SourceList"
,
&
hkey
);
res
=
RegCreateKeyA
(
prodkey
,
"SourceList"
,
&
hkey
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
@@ -624,19 +618,13 @@ static void test_MsiSourceListAddSourceEx(void)
...
@@ -624,19 +618,13 @@ static void test_MsiSourceListAddSourceEx(void)
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
res
=
RegOpenKeyA
(
prodkey
,
"SourceList
\\
URL"
,
&
url
);
res
=
RegOpenKeyA
(
prodkey
,
"SourceList
\\
URL"
,
&
url
);
todo_wine
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
{
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
}
size
=
MAX_PATH
;
size
=
MAX_PATH
;
res
=
RegQueryValueExA
(
url
,
"1"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
res
=
RegQueryValueExA
(
url
,
"1"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
todo_wine
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
{
ok
(
!
lstrcmpA
(
value
,
"C:
\\
source/"
),
"Expected 'C:
\\
source/', got %s
\n
"
,
value
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
size
==
11
,
"Expected 11, got %d
\n
"
,
size
);
ok
(
!
lstrcmpA
(
value
,
"C:
\\
source/"
),
"Expected 'C:
\\
source/', got %s
\n
"
,
value
);
ok
(
size
==
11
,
"Expected 11, got %d
\n
"
,
size
);
}
RegCloseKey
(
url
);
RegCloseKey
(
url
);
...
@@ -648,28 +636,19 @@ static void test_MsiSourceListAddSourceEx(void)
...
@@ -648,28 +636,19 @@ static void test_MsiSourceListAddSourceEx(void)
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
res
=
RegOpenKeyA
(
prodkey
,
"SourceList
\\
URL"
,
&
url
);
res
=
RegOpenKeyA
(
prodkey
,
"SourceList
\\
URL"
,
&
url
);
todo_wine
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
{
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
}
size
=
MAX_PATH
;
size
=
MAX_PATH
;
res
=
RegQueryValueExA
(
url
,
"1"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
res
=
RegQueryValueExA
(
url
,
"1"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
todo_wine
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
{
ok
(
!
lstrcmpA
(
value
,
"C:
\\
source/"
),
"Expected 'C:
\\
source/', got %s
\n
"
,
value
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
size
==
11
,
"Expected 11, got %d
\n
"
,
size
);
ok
(
!
lstrcmpA
(
value
,
"C:
\\
source/"
),
"Expected 'C:
\\
source/', got %s
\n
"
,
value
);
ok
(
size
==
11
,
"Expected 11, got %d
\n
"
,
size
);
}
size
=
MAX_PATH
;
size
=
MAX_PATH
;
res
=
RegQueryValueExA
(
url
,
"2"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
res
=
RegQueryValueExA
(
url
,
"2"
,
NULL
,
NULL
,
(
LPBYTE
)
value
,
&
size
);
todo_wine
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
{
ok
(
!
lstrcmpA
(
value
,
"another/"
),
"Expected 'another/', got %s
\n
"
,
value
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
size
==
9
,
"Expected 9, got %d
\n
"
,
size
);
ok
(
!
lstrcmpA
(
value
,
"another/"
),
"Expected 'another/', got %s
\n
"
,
value
);
ok
(
size
==
9
,
"Expected 9, got %d
\n
"
,
size
);
}
RegCloseKey
(
url
);
RegCloseKey
(
url
);
RegCloseKey
(
prodkey
);
RegCloseKey
(
prodkey
);
...
...
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